Distributed Message Service RocketMQ

Message Traces

2024-07-04 06:17:08

When sending a message from its origin at the producer to the RocketMQ server, and finally to the consumers, RocketMQ records the flow progress of the message and displays the time and execution status of each phase.

Note:

By default, the message trace feature is disabled on clients that use SDKs. If you use such a client and want to query message traces, you must enable the message trace feature in the messaging code. The following codes show how to enable this feature for JAVA:

l   Enabling message trace for producers:

DefaultMQProducer producer = new DefaultMQProducer("ProducerGroupName", new AclClientRPCHook(new SessionCredentials("Console role AK","Console roleCK")), true, null);

l   Enabling message trace for consumers:

DefaultMQPushConsumer consumer = new DefaultMQPushConsumer("ConsumerGroupName", new AclClientRPCHook(
                new SessionCredentials(
                        "Console role AK",
                        "Console role CK")
        ), new AllocateMessageQueueAveragely(), true, null);

Methods for Querying Message Traces:

1.         On the eSurfing Cloud official website, click Control Center and select RocketMQ.

2.         Log in to the DMS RocketMQ console and click Region in the upper right corner to select the corresponding resource pool.

3.         Go to the instance list and click Manage to enter the management menu.

4.         On the message query menu, you can query message traces by key, ID or offset.

5.         Based on the query result, you can view message traces.


scIy4CUmgAdk