When messages are lost or fail to be consumed, you can query the content and attributes of specific messages for troubleshooting.
You can view the offset of different partitions, the message size, creation time, and body of messages in topics.
in the upper left corner to select the region where your instance is located.
in the upper left corner and choose Application > Distributed Message Service for Kafka to open the Kafka instance list.Parameter | Description |
|---|---|
Topic Name | Displayed only when you choose Instance > Message Query. Name of the topic to be queried. |
Partition | Partition where the message is located. |
Offset | Offset of the message. |
Parameter | Description |
|---|---|
Topic Name | Displayed only when you choose Instance > Message Query. Name of the topic to be queried. |
Partition | Partition where the message is located. If no partition is specified, messages in all partitions of the topic are displayed in the query result. Constraints on partition-based message query:
To query more messages, shorten the query time range or specify partitions. |
Key | Enter a message key to search for messages containing it. For example, a topic contains two messages whose keys are abc and abcd. Enter "abc" in the Key box. The two messages are returned. Query with a key: Due to resource and performance limitations, a maximum of 10,000 messages can be searched, and the total size of all messages cannot exceed 200 MB. Only 10 messages containing the key are returned. |
Content | Multiple query conditions can be set. Query results meet all of them. To set a query condition:
Query with content: Due to resource and performance limitations, a maximum of 10,000 messages can be searched, and the total size of all messages cannot exceed 200 MB. Only 10 messages containing the keyword are returned. For large records (> 20 KB per message) or a long period, dump messages for offline query. |
Created | Time when a message is created. You can set the time range of messages to be queried. WARNING: If a topic contains a large amount of data, an internal service error may be reported when you query messages in a topic with only one replica. You can shorten the time range for query based on the data volume. |
The query result is as follows.
Figure 1 Querying topic messages

Parameter | Description |
|---|---|
Topic Name | Name of the topic where the message is located. |
Partition | Partition where the message is located. |
Offset | Position of the message in the partition. |
Message Size (Byte) | Size of the message. |
Created | Time when the message is created. The message creation time is specified by CreateTime when a producer creates messages. If this parameter is not set during message creation, the message creation time is year 1970 by default. |
The console displays messages smaller than 4 KB. To view messages larger than 4 KB, click Download Message.