This is a basic spring boot kafka producer and kafka consumer helloworld application
The following guides illustrates how to use certain features concretely:
- Download kafka from https://kafka.apache.org/downloads
- Here we have used kafka_2.11-2.1.1
- Start the Zookeeper- Go to the kafka installation path and run below command in command prompt window
C:\kafka_2.12-0.10.2.1> .\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
- start the Apache Kafka- Go to the kafka installation path, Open new command prompt window and run below command
C:\kafka_2.12-0.10.2.1> .\bin\windows\kafka-server-start.bat .\config\server.properties
After Successful start Kafka server run kafka-consumer spring boot application
Run kafka-producer spring boot application. After successful start kafka-producer app Open any browser and run below url.
http://localhost:8080//kafka/producer?message=Hello Kafka!
You should get response “Message sent to the Kafka Topic Successfully” and check kafka-consumer app console. You can see message in console log.