Kafka Consumer CLI
The Kafka console consumer CLI, kafka-console-consumer is used to read data from Kafka and output it to standard output.
References
Flashcards
From the CLI, consume all people messages from the beginning:: kafka-console-consumer --bootstrap-server localhost:9092 --topic people --from-beginning
From the CLI, consume all pet messages and print the key of messages from the beginning:: kafka-console-consumer --bootstrap-server localhost:9092 --topic pets --from-beginning --property print.key=true
From the CLI, specify an explicit consumer group id while consuming from pets topic and print each messages offset from the beginning:: kafka-console-consumer --bootstrap-server localhost:9092 --topic pets --from-beginning --group adam-pet-consumer --property print.offset=true
From the CLI, specify an explicit consumer group id adam-people-consumer for people topic and print message timestamp from the beginning::kafka-console-consumer --bootstrap-server localhost:9092 --topic people --from-beginning --group adam-people-consumer --property print.timestamp=true
The kafka-console-consumer CLI, when used with the default options uses a random group id
Which Kafka CLI should you use to consume from a topic?:: kafka-console-consumer