Perform the following steps to generate messages to verify the producer and consumer:
- Send messages to Kafka my-first-topic:
bin/kafka-console-producer --broker-list localhost:9092 --topic my-first-topictest1test2test3
- Start consumer to consume messages
- Open another terminal and enter the following command:
$ bin/kafka-console-consumer --bootstrap-server localhost:9092 --topic my-first-topic --from-beginningtest3test2test1
- Go to the producer terminal and enter another message:
test4
- Verify the consumer terminal to check whether you can see the message test4