Get topic offsets
Show earliest and latest offsets per partition
kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list kafka:9092 --topic <name>
- tool
- kafka20 commands
More kafka commands
-
kafka-topics.sh --bootstrap-server kafka:9092 --create --topic my-topic --partitions 6 --replication-factor 3Create a new Kafka topic with 6 partitions and RF=3
-
kafka-consumer-groups.sh --bootstrap-server kafka:9092 --describe --group my-groupShow per-partition lag for a consumer group
-
kafka-consumer-groups.sh --bootstrap-server kafka:9092 --group my-group --reset-offsets --to-earliest --topic my-topic --executeReset consumer offsets to earliest
-
kafka-console-producer.sh --bootstrap-server kafka:9092 --topic my-topic --property 'key.separator=:' --property 'parse.key=true'Produce key:value messages interactively
-
kafka-console-consumer.sh --bootstrap-server kafka:9092 --topic my-topic --from-beginning --max-messages 10Read first 10 messages from a topic