DefaultMQProducer producer = new DefaultMQProducer(namespace, groupName,// ACL permissionnew AclClientRPCHook(new SessionCredentials(AK, SK)), true, null);
// Instantiate the consumerDefaultMQPushConsumer pushConsumer = new DefaultMQPushConsumer(NAMESPACE,groupName,new AclClientRPCHook(new SessionCredentials(AK, SK)),new AllocateMessageQueueAveragely(), true, null);
DefaultLitePullConsumer pullConsumer = new DefaultLitePullConsumer(NAMESPACE,groupName,new AclClientRPCHook(new SessionCredentials(AK, SK)));// Set the NameServer addresspullConsumer.setNamesrvAddr(NAMESERVER);pullConsumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_LAST_OFFSET);pullConsumer.setAutoCommit(false);pullConsumer.setEnableMsgTrace(true);pullConsumer.setCustomizedTraceTopic(null);
package com.lazycece.sbac.rocketmq.messagemodel;import lombok.extern.slf4j.Slf4j;import org.apache.rocketmq.spring.annotation.MessageModel;import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;import org.apache.rocketmq.spring.core.RocketMQListener;import org.springframework.stereotype.Component;/*** @author lazycece* @date 2019/8/21*/@Slf4j@Componentpublic class MessageModelConsumer {@Component@RocketMQMessageListener(topic = "topic-message-model",consumerGroup = "message-model-consumer-group",enableMsgTrace = true,messageModel = MessageModel.CLUSTERING)public class ConsumerOne implements RocketMQListener<String> {@Overridepublic void onMessage(String message) {log.info("ConsumerOne: {}", message);}}}
Parameter | Description |
Producer Address | Address and port of the producer. |
Production Time | The time when the TDMQ for RocketMQ server acknowledged message receipt, accurate down to the millisecond. |
Sending Duration | The time it took to send the message from the producer to the TDMQ for RocketMQ server, accurate down to the microsecond. |
Production Status | Message production success or failure. If the status is Failed, it is generally because the header of the message was lost during sending, and the above fields may be empty. |
Parameter | Description |
Storage Time | The time when the message was persistently stored. |
Storage Duration | The duration between when the message was persistently stored and when the TDMQ for RocketMQ server received the acknowledgment, accurate down to the millisecond. |
Storage Status | Message storage success or failure. If the status is Failed, the message failed to be stored on the disk, which is possibly because the underlying disk was damaged or full. In this case, submit a ticket for assistance as soon as possible. |
Parameter | Description |
Consumer Group Name | Name of the consumer group. |
Consumption Mode | The consumer group's consumption mode, which can be either cluster consumption or broadcast consumption. For more information, see Cluster Consumption and Broadcast Consumption. |
Number of Pushes | The number of times the TDMQ for RocketMQ server has delivered the message to consumers. |
Last Pushed | The last time the TDMQ for RocketMQ server delivered the message to consumers. |
Consumption Status | Pushed yet unacknowledged: The TDMQ for RocketMQ server has delivered the message to consumers but has not received their acknowledgment. Acknowledged: Consumers acknowledged the consumption and the TDMQ for RocketMQ server has received the acknowledgment. Put to retry queue: Acknowledgment timed out. The server will deliver the message to consumers again as it did not receive their acknowledgment. Retried yet unacknowledged: The TDMQ for RocketMQ server has delivered the message to consumers again but still has not received their acknowledgment. Put to dead letter queue: The message has been put to the dead letter queue as it failed to be consumed after multiple retries. Note: If the consumption mode is broadcast, the consumption status can only be Pushed. |
Parameter | Description |
Push Sequence | The sequence number in which the TDMQ for RocketMQ server delivers the message to consumers. |
Consumer Address | Address and port of the consumer receiving the message. |
Push Time | The time when the TDMQ for RocketMQ server delivers the message to consumers. |
Consumption Status | Pushed yet unacknowledged: The TDMQ for RocketMQ server has delivered the message to consumers but has not received their acknowledgment. Acknowledged: Consumers acknowledged the consumption and the TDMQ for RocketMQ server has received the acknowledgment. Put to retry queue: Acknowledgment timed out. The server will deliver the message to consumers again as it did not receive their acknowledgment. Retried yet unacknowledged: The TDMQ for RocketMQ server has delivered the message to consumers again but still has not received their acknowledgment. Put to dead letter queue: The message has been put to the dead letter queue as it failed to be consumed after multiple retries. Redelivered to retry queue: On the dead letter queue resending page, the dead letter message has been redelivered to the retry queue of the original queue. |
Was this page helpful?