Kafka learning-the fourth Kafka basic operation command

1. Create a topic

bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic testTopic1

2. View the topic information that has been created

bin/kafka-topics.sh --list --zookeeper localhost:2181

3. Producer sends message

bin/kafka-console-producer.sh --broker-list localhost:9092 --topic testTopic1
This is a message
This is another message

4. Consumer consumption news

bin/kafka-console-consumer.sh --bootstrap-server localhost:2181 --from-beginning --topic testTopic1
Published 40 original articles · 25 praises · 100,000+ views

Guess you like

Origin blog.csdn.net/yym373872996/article/details/105654051