Viewing Kafka Messages
You can view the offset of different partitions, the message size, creation time, and body of messages in topics.
Notes and Constraints
- 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.
- To query with content, due to resource and performance restrictions, a total of 200 MB and 10,000 messages can be queried, and a maximum of 10 messages can be returned.
- The console displays messages smaller than 4 KB. To view messages larger than 4 KB, click Download Message.
Procedure
- Log in to the console.
- Click
in the upper left corner to select the region where your instance is located.
- Click
and choose Middleware > Distributed Message Service (for Kafka) to open the console of DMS for Kafka.
- In the navigation pane, choose Kafka Instances.
- Click the desired instance to go to the instance details page.
- In the left navigation pane, choose Message Query.
- Messages can be queried by creation time or offset. For details, see Table 1 and Table 2.
Table 1 Querying messages by creation time Parameter
Description
Topic Name
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.
Content
Enter a keyword in the message body.
NOTE:Due to resource and performance restrictions, query with content is limited to 10 results. Each search covers at most 10,000 records, or 200 MB. For large records (> 20 KB per message) or a long period, dump messages for offline query.
Created
A time range to be queried.
NOTE: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.
- Click Search to query messages.
The query result is as follows.
Figure 1 Querying topic messagesParameter 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.
- Click View Message Body. In the displayed View Message Body dialog box, view the message content, including the topic name, partition, offset, creation time, and message body.
The console displays messages smaller than 4 KB. To view messages larger than 4 KB, click Download Message.
- (Optional) To restore the default settings, click Reset.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot