Think before you speak, read before you think.

kafka-console-consumer 对 topic 测试

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.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *