To Start Kafka Server
.\bin\windows\kafka-server-start.bat .\config\server.properties .\bin\windows\kafka-server-stop.bat .\config\server.properties
To Start Zookeeper Server
.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties .\bin\windows\zookeeper-server-stop.bat .\config\zookeeper.properties
Create Topic in Kafka with 5 Partition and Replication factor of 1
kafka-topics.bat --bootstrap-server localhost:9092 --topic --create firsttopic --partitions 5 --replication-factor 1
Note: Replication Factor cannot be more than 1 incase of localhost.
List Topics
kafka-topics.bat --bootstrap-server localhost:9092 --topic --list
Describe Topic
kafka-topics.bat --bootstrap-server localhost:9092 --topic firsttopic --describe
Delete Topic
kafka-topics.bat --bootstrap-server localhost:9092 --topic firsttopic --delete
Producer to push data into Topic in Kafka
kafka-console-producer.bat --broker-list localhost:9092 --topic test
Consumer to pull data from Topic in Kafka
kafka-console-consumer.bat --topic test --bootstrap-server localhost:9092 --from-beginning
{“Message”: “Hello World from Kafka”}