Install Kafka on Windows

Commands

Start Zookeeper Server

.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties

Start Kafka Server / Broker

.\bin\windows\kafka-server-start.bat .\config\server.properties

Create Topic

.\bin\windows\kafka-topics.bat --bootstrap-server localhost:9092 --create --topic test --partitions 3 --replication-factor 1

Produce Message

.\bin\windows\kafka-console-producer.bat --broker-list localhost:9092 --topic test

Consume Message

.\bin\windows\kafka-console-consumer.bat --topic test --bootstrap-server localhost:9092 --from-beginning

Describe topics

.\bin\windows\kafka-topics.bat --bootstrap-server localhost:9092 --describe --topic NewTopic

List all the topics

.\bin\windows\kafka-topics.bat --bootstrap-server localhost:9092 --list

Stop Zookeeper

.\bin\windows\zookeeper-server-stop.bat .\config\zookeeper.properties

Stop Kafka Server

.\bin\windows\kafka-server-stop.bat .\config\server.properties
Scroll to Top