Overview
When encountering a consumption exception, such as message loss or message consumption failed, you can troubleshoot the problem by querying the message in the CKafka console.
The CKafka console supports query by offset and time, which are used in different scenarios:
Query by offset: You know the ID of a topic's partition to which the message is sent and the offset of the message.
Query by time: You don't know the offset of the message but know when the message is sent.
Restrictions and Limitations
Per request shows up to 20 messages after the start time or start offset (if fewer than 20 messages exist, it shows the full display).
Querying messages consumes bandwidth. Avoid frequent operations.
Current message query only supports querying messages up to 1 MB.
Whether messages can be queried depends on the message retention mechanism. Users can configure how long messages can be retained or how much space they occupy before being deleted. Meanwhile, CKafka supports configurable dynamic message retention.
Directions
Query by offset
2. Select Message Query in the left sidebar. After selecting a region, set query conditions on the message query page.
Instance: Select the instance to view in the dropdown list.
Topic: Select the topic where the message resides in the dropdown list.
Query type: Supports two methods, query by offset and query by time.
Partition ID: Select the partition where the message resides.
Start offset: When the query type is query by offset, enter the start offset of the message.
Time: When the query type is query by time, set the start time of the query, accurate to the second.
3. Click Query to view message information.
Partition ID: Topic partition to which the message is sent.
Offset: Consumer offset of the message.
Timestamp: timestamp in ProducerRecord.
Operation:
Click Download Message to download the message in the format of "header, key, value", format, supporting batch download messages.
Click Message Details to view the key and value of the message.