DefaultMQProducer producer = new DefaultMQProducer(namespace, groupName,// Access control list (ACL) permissions.new AclClientRPCHook(new SessionCredentials(AK, SK)), true, null);
// Instantiate a consumer.DefaultMQPushConsumer 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 address.pullConsumer.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 |
Production Address | Address and port number of the producer. |
Production Time | Time when the TDMQ for RocketMQ server acknowledges receiving a message, accurate to milliseconds. |
Sending Duration | Time used to send a message from the producer to the TDMQ for RocketMQ server, accurate to microseconds. |
Production Status | Whether a message is produced successfully. If the status is failed, certain header data of the message may be lost during message sending, and the preceding fields may be null. |
Parameter | Description |
Storage Time | Message persistence duration. |
Storage Status | Whether a message is persisted successfully. If the status is failed, the message fails to be saved to the disk. This may be caused by underlying disk damage or insufficient space. In such a case, you need to submit a ticket as soon as possible. |
Parameter | Description |
Consumer Group Name | Name of a consumer group. |
Consumption Mode | Consumption mode of a consumer group. Two modes are supported: clustering consumption and broadcasting consumption. |
Number of Pushes | Number of times that the TDMQ for RocketMQ server delivers a message to the consumer. |
Last Push Time | The last time the TDMQ for RocketMQ server delivered a message to the consumer. |
Consumption End Time | Time when the TDMQ for RocketMQ server receives an acknowledgment message from the consumer. |
Consumption Duration | Time interval from when the TDMQ for RocketMQ server sends a message to a consumer for the first time to when the TDMQ for RocketMQ server receives an acknowledgment message from the consumer. |
Consumption Status | Pushed but not confirmed: The TDMQ for RocketMQ server has delivered a message to the consumer, but has not received an acknowledgment message from the consumer. Confirmed: The consumer replies with an acknowledgment message to the TDMQ for RocketMQ server, and the server has received the acknowledgment message. Acknowledgment timeout: The server has not received an acknowledgment message before the timeout and will redeliver the message. Retried but not confirmed: The TDMQ for RocketMQ server has redelivered the message to the consumer, but has not received an acknowledgment message from the consumer. Transferred to the dead letter queue: The message is delivered to the dead letter queue as it still failed to be consumed normally after a certain number of retries. Note: If the consumption mode is broadcast consumption, the consumption status can only be Pushed but not confirmed. |
Parameter | Description |
Push Order | Number of times that the TDMQ for RocketMQ server delivers a message to the consumer. |
Consumption Address | Address and port number of the consumer that receives a message. |
Consumption Start Time | Time when the TDMQ for RocketMQ server delivers a message to the consumer. |
Consumption End Time | Time when the TDMQ for RocketMQ server receives an acknowledgment message from the consumer. |
Consumption Duration | Time interval from when the TDMQ for RocketMQ server sends a message to a consumer to when the TDMQ for RocketMQ server receives an acknowledgment message from the consumer. |
Consumption Status | Pushed but not confirmed: The TDMQ for RocketMQ server has delivered a message to the consumer, but has not received an acknowledgment message from the consumer. Confirmed: The consumer replies with an acknowledgment message to the TDMQ for RocketMQ server, and the server has received the acknowledgment message. Acknowledgment timeout: The server has not received an acknowledgment message before the timeout and will redeliver the message. Retried but not confirmed: The TDMQ for RocketMQ server has redelivered the message to the consumer, but has not received an acknowledgment message from the consumer. Transferred to the dead letter queue: The message is delivered to the dead letter queue as it still failed to be consumed normally after a certain number of retries. Page dead letter redelivery completed: On the dead letter queue redelivery page, the user has redelivered the message in the dead letter queue to the retry queue of the original queue. |
Feedback