Consume from beginning

Read all messages from a topic starting from offset 0

kafka-console-consumer.sh --bootstrap-server kafka:9092 --topic <name> --from-beginning

tool
kafka20 commands
tags
kafkadebug

More kafka commands

  • kafka-console-producer.sh --bootstrap-server kafka:9092 --topic <name>

    Send messages to a topic interactively from stdin

  • kafka-consumer-groups.sh --bootstrap-server kafka:9092 --list

    Show all consumer groups

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

    Show lag per partition for a consumer group

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

    Reset a consumer group to the beginning of the topic

  • kafka-topics.sh --bootstrap-server kafka:9092 --alter --topic <name> --partitions 6

    Increase (only) the number of partitions for a topic

all 20 kafka commands