This repository demonstrates basic Apache Kafka message producer and consumer applications built with Java and Spring Boot.
Start up ZooKeeper:
.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
Start up Kafka:
.\bin\windows\kafka-server-start.bat .\config\server.properties
Create a Kafka topic:
.\bin\windows\kafka-topics.bat --bootstrap-server localhost:9092 -topic country --create
--partitions 2 --replication-factor 1
List all topics:
.\bin\windows\kafka-topics.bat --bootstrap-server localhost:9092 -topic --list
View live message stream:
.\bin\windows\kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic country --from-beginning
After startup and configuration of Kafka, start the kafka-consumer application to listen and view the messages in the kafka topic, start the kafka-producer application to publish messages to the kafka topic.