Apache Kafka is an open source Stream processing platform developed by Apache.
This project aims to provide high through-put, low-latency and real time data feeds
- Download Apache Kafka from software folder
- Start Apache Zookeper (.\bin\zookeeper-server-start.bat .\config\zookeeper.properties)
- Start Apache Kafka (. \bin\kafka-server-start.bat .\config\server.properties)
- Create a topic with some name(In the example, topic name is javainuse-topic) (.\bin\kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic javainuse-topic)
- Create a Producer (.\bin\kafka-console-producer.bat --broker-list localhost:9092 --topic javainuse-topic Hello World)
- Create a Consumer (.\bin\kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic javainuse-topic --from-beginning)
- Download and start the boot application, ensure your Kafka also runs on the same port
- And hit URL http://localhost:8080//javainuse-kafka/producer?message=test
- See the data in Kafka Tool for more details
Ref 1 : https://www.javainuse.com/misc/apache-kafka-hello-world Ref 2 : https://www.javainuse.com/spring/spring-boot-apache-kafka-hello-world