Products

Message Queue

2022-02-21 06:21:00

Message Trace

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.

Precondition

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.

  • Java SDK (Version): V1.3.0 and above
  • Make sure that the Producer and Consumer enable the message trace recording, and the client is configured to be disabled by default

The method of setting the message trace to be enabled is as follows:

Code Example


        
        //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();
                

Operation Steps

  1. Enter the message queue JCQ console, and select Message Query at left side menu.
  2. Select the region where the message to be queried is located, select any tab, and enter information for message query.
  3. Select the problematic message and click message trace in the operation to view the status to identify the problem.

Message track-01

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.

Display Data

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 time: The timestamp when the message is sent from the client (producer)
  • Time consumed for sending: The time consumed for a message to travel from the client (producer) to the server, in units of: Millisecond
  • Sending status:
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
  • Time of consumption: The timestamp when the client (consumer) started consuming the message
  • Time consumed for consumption: The time consumed from the client (consumer) starts consuming the message to confirming the message, in units of:: Millisecond
    • If the message confirmation times out, the time consumed for consumption cannot be calculated
  • Consumption status:

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
Feedback

开始与售前顾问沟通

可直接拨打电话 400-098-8505转1

我们的产品专家为您找到最合适的产品/解决⽅案

在线咨询 5*8⼩时

1v1线上咨询获取售前专业咨询

点击咨询
企微服务助手

专业产品顾问,随时随地沟通