Apache Kafka consume and produce messages using Kafka CLI command
“kafka-console-producer” and “kafka-console-consumer” command Is used for testing topic message delivery and efficient utility for testing our topic and Apache Kafka environment. We need to specify our Kafka instance / port and topic name as parameter for these commands
Kafka Consume Topic Command
kafka-console-consumer.bat –bootstrap-server localhost:9092 –topic first.
Kafka Produce Topic Command
kafka-console-producer.bat –broker-list localhost:9092 –topic first
Start sending data from Producer console
You can send data from Producer console application and you can immediately retrieve the same message on consumer application as follows.
Small topic for understanding sending and receiving topic messages using build in utility command. We can use Kafka SDK tool for application level message delivery and consumption. Will soon provide article for how we can use the SDK for consuming Apache Kafka messages using dotnet core