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
tags
kafkadebug

More kafka commands

  • kafka-topics.sh --bootstrap-server kafka:9092 --create --topic my-topic --partitions 6 --replication-factor 3

    Create a new Kafka topic with 6 partitions and RF=3

  • kafka-consumer-groups.sh --bootstrap-server kafka:9092 --describe --group my-group

    Show 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 --execute

    Reset 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 10

    Read first 10 messages from a topic

all 20 kafka commands