Consume from the beginning
Read all messages in a topic, starting from the earliest available offset
kafka-console-consumer.sh --bootstrap-server kafka:9092 --topic <name> --from-beginning
- tool
- kafka20 commands
More kafka commands
-
kafka-console-producer.sh --bootstrap-server kafka:9092 --topic <name>Type messages in stdin and send them to a topic
-
kafka-consumer-groups.sh --bootstrap-server kafka:9092 --listShow all consumer groups
-
kafka-consumer-groups.sh --bootstrap-server kafka:9092 --describe --group <group>Show lag for each partition of a consumer group
-
kafka-consumer-groups.sh --bootstrap-server kafka:9092 --group <group> --topic <topic> --reset-offsets --to-earliest --executeMove a consumer group back to the beginning of the topic
-
kafka-topics.sh --bootstrap-server kafka:9092 --alter --topic <name> --partitions 6Increase the number of partitions in a topic (you cannot decrease it)