tar -xzf kafka_2.13-3.2.1.tgz
cd kafka_2.13-3.2.1
We started to run seperate two service for Kafka as called Zookeeper and Kafka broker service.
# Start the ZooKeeper service
$ bin/zookeeper-server-start.sh config/zookeeper.properties
Open another terminal session and run:
# Start the Kafka broker service
$ bin/kafka-server-start.sh config/server.properties
Open another terminal session and run to create a topic.
$ bin/kafka-topics.sh --create --topic ${topic_name} --bootstrap-server localhost:9092
$ bin/kafka-console-producer.sh --topic ${topic_name} --bootstrap-server localhost:9092
This is my first event
This is my second event
You can stop the event producing with CTRL+C
.
Open another terminal session and run the console consumer client to read the events you just created.
$ bin/kafka-console-consumer.sh --topic ${topic_name} --from-beginning --bootstrap-server localhost:9092