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