Skip to content
Kafka Is FunProgress

BeginnerOperations

What is the difference between kafka-console-producer and kafka-console-consumer?

Reference answer

kafka-console-producer.sh is a CLI tool that reads lines from stdin and sends each line as a message to a Kafka topic. It's useful for manual testing and injecting test data. kafka-console-consumer.sh reads messages from a Kafka topic and prints them to stdout. It accepts --from-beginning to read from offset 0. Both tools are part of the Kafka distribution and use the standard Java producer/consumer clients. They're primarily for development, testing, and debugging — not production use.

Expected key concepts: kafka-console-producer, kafka-console-consumer, CLI, stdin, stdout, testing, from-beginning, development, debugging