Reset consumer group offsets

Move consumer offsets back to the earliest offset of the topic

kafka-consumer-groups.sh --bootstrap-server kafka:9092 --group my-group --reset-offsets --to-earliest --topic my-topic --execute

tool
kafka20 commands
tags
kafka

More kafka commands

  • kafka-console-producer.sh --bootstrap-server kafka:9092 --topic my-topic --property 'key.separator=:' --property 'parse.key=true'

    Type key:value messages and send them to the topic

  • kafka-console-consumer.sh --bootstrap-server kafka:9092 --topic my-topic --from-beginning --max-messages 10

    Read the first 10 messages of a topic

  • kafka-topics.sh --bootstrap-server kafka:9092 --alter --topic my-topic --partitions 12

    Increase the partition count (you cannot decrease it)

  • kafka-configs.sh --bootstrap-server kafka:9092 --describe --entity-type topics --entity-name my-topic

    Show all config values that are overridden for a topic

  • kafka-configs.sh --bootstrap-server kafka:9092 --alter --entity-type topics --entity-name my-topic --add-config retention.ms=604800000

    Keep messages in a topic for 7 days

all 20 kafka commands