To listen for messages on a topic:
kafka-console-consumer --bootstrap-server kafka:9092 --topic test1 --from-beginning
To stop the listener session above press: Ctrl+C
To start an interactive message producer session:
kafka-console-producer --broker-list kafka-headless:9092 --topic test1
To create a message in the above session, simply type the message and press “enter”
To end the producer session try: Ctrl+C
If you specify “zookeeper.connect” in configurationOverrides, please replace “kafka-zookeeper:2181” with the value of “zookeeper.connect”, or you will get error.
Leave a Reply