The message trace refers to the complete link information formed by convergence of the time and place of each relevant node in the whole process from a message being sent from the producer to being consumed and processed by the consumer. It can help users solve the problem that the producer and consumer cannot determine the message status due to the decoupling of production and consumption, and help users locate the problem and understand the detailed status of the message.
Before and after the producer sends the message, before and after the consumer consumes the message and before and after the message is confirmed, the points are recorded, and are sent to JCQ for statistics and calculation of the track information.
For the time being, only the messages sent and received by the JAVA SDK support the message trace function, and the messages sent and received using the HTTP API do not support message trace query.
The method of setting the message trace to be enabled is as follows:
//Enable the producer message trace, configure the attribute enableMessageTrace
ProducerConfig producerConfig = ProducerConfig.builder()
.metaServerAddress(META_SERVER_ADDRESS)
.enableMessageTrace(true)
.build();
//Enable the consumer message trace, configure the attribute enableMessageTrace
ConsumerConfig consumerConfig = ConsumerConfig.builder()
.consumerGroupId(CONSUMER_GROUP_ID)
.metaServerAddress(META_SERVER_ADDRESS)
.enableMessageTrace(true)
.build();
Rules:
Delayed message: The system time has not reached the specified delivery time, and the message cannot be queried in the message query, but can be queried by calling the message trace interface separately.
Consumption confirmation time-out (ACK time-out): If the message confirmation times out, the consumption time cannot be calculated, and the consumption status is consumption failure.
Message trace valid time: The time of the message trace recording is the same as the life cycle of the message, which is 3 days.
The production and consumption of messages involves three roles, namely, the producer, server and consumer. Each production and consumption will generate a message trace. The information displayed by the message trace function is summarized as follows:
Producer | Message Queue | Consumer | |
---|---|---|---|
Display data | - Producer IP - Sending time - Time consumed for sending - Sending status - Delay time |
- Store Topic - Topic type - Topic region - Storage duration - Topic related attributes |
- Consumer IP - Consumption time - Consumption status - Time consumed for consumption |
Name explanation:
Sending Status | Status Code | Remarks |
---|---|---|
Sending success | SUCCESS_NORMAL | Message sent successfully and having been successfully stored by the server |
Sending failure | FAILED | Message sent unsuccessfully and having not been stored by the server, and is required to be retried |
Successfully sent (delay:? seconds) | SUCCESS_DELAY | The message is a timed or delayed message, which may not have been delivered to the consumer |
Consumption group status
Consumption Group Consumption Status | Status Code | Remarks |
---|---|---|
Unconsumed | UNCONSUMED | The message has not been delivered to the consumption group or the tag mismatches and has been filtered |
Consumption success, at least be consumed once | SUCCESS | The message has been successfully consumed by the consumption group |
Consumption failure, about to try to consume for the xth time | FAILED_RETRY | The consumption group fails to consume the message, waiting for retry |
All consumption fails, please go to the dead letter queue to process this message | ALL_FAILED | All consumption attempts for this message failed |
Unknown status | UNKNOWN | Unlisted status |
Consumer status:
Consumer Status | Status Code | Remarks |
---|---|---|
Consumption Success | SUCCESS | This Consumption is Successful |
Consumption failed, no consumption result returned | FAILED_WITHOUT_RESULT | The result of the method of consuming messages this time has not been returned or is interrupted, resulting in this consumption result not being returned to the server |
Consumption failed, consumption confirmation failed | FAILED_WITH_RESULT | This consumption failed, and the consumption confirmation return failed |
我们的产品专家为您找到最合适的产品/解决⽅案
1v1线上咨询获取售前专业咨询
专业产品顾问,随时随地沟通