Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@marwei
marwei / how_to_inspect_kafka_log_metadata.md
Last active December 6, 2017 19:57
How to Inspect Kafka Log to Get Message's Metadata
<PATH_TO_KAFKA>/bin/kafka-run-class kafka.tools.DumpLogSegments --files /tmp/kafka-logs/<TOPIC>00000000000000000000.log --print-data-log
@marwei
marwei / how_to_reset_kafka_consumer_group_offset.md
Created November 9, 2017 23:39
How to Reset Kafka Consumer Group Offset

Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.

  1. List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe

Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.

  1. Reset the consumer offset for a topic (preview)