This demo contains examples of String
datatype Producer/Consumer and JSON Object
Datatype Producer/Consumer.
- Step 1 : After download and installing Kafka,
To Start the Environment
.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
- Step 2 :
To Start the Kafka Broker Service
.\bin\windows\kafka-server-start.bat .\config\server.properties
- Step 3 :
To Create a Topic to Store your Events
.\bin\windows\kafka-topics.bat --create --topic
your-kafka-topic-name --bootstrap-server localhost:9092
- Step 4 :
To Write some Events to the Created Topic
.\bin\windows\kafka-console-producer.bat --topic
your-kafka-topic-name bootstrap-server localhost:9092
> Hello World
> This is Kafka Stream Processing World
- Step 5 :
To Read the Events
.\bin\windows\kafka-console-consumer.bat --topic
your-kafka-topic-name --from-beginning --bootstrap-server localhost:9092
The Messages will Printed to the Consumer Console
Hello World
This is Kafka Stream Processing World
-
GitHub Repository 1 Ramesh Fadatare - Java Guides
-
GitHub Repository 2 Ramesh Fadatare - Java Guides
-
GitHub Repository 3 Bouali Ali