Viewing Kafka Messages
Scenario
You can view the offset of different partitions, the message size, creation time, and body of messages in topics.
Viewing Kafka Messages
- Log in to the console.
- Click in the upper left corner to select a region.
Select the region where your Kafka instance is located.
- Click and choose Application > Distributed Message Service for Kafka to open the console of DMS for Kafka.
- Click the desired Kafka instance to view the instance details.
- In the left navigation pane, choose Message Query.
- Set the query parameters by referring to Table 1.
Table 1 Message query parameters Parameter
Description
Topic Name
Name of the topic to be queried.
Partition
Partition where the messages are located.
If no partition is specified, messages in all partitions of the topic are displayed in the query result.
Search By
The following methods are supported:
- Creation time: Search by the time that messages are created.
- Offset: Search by the message position.
Search For
This parameter is displayed only when Search By is set to Creation time.
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.
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 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.
- 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