Set up and Install Apache Kafka On Windows
Prerequisites: Install Java
Step 1:
Download the kafka from https://kafka.apache.org/downloads
Extract the downloaded file using 7 zip
Step 2:
Kafka uses zookeeper so you first need to start the ZooKeeper Server, zookeeper is packaged with kafka
Run the below command to start zookeeper
.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
Once the ZooKeeper starts, run the kafka instance using below command
Step 3:
.\bin\windows\kafka-server-start.bat .\config\server.properties
Server started:
Installation is completed for kafka now you can create topic to publish the message in Kafka
Step 4:
Command to create the topic
kafka-topics.bat –create –bootstrap-server localhost:9092 –replication-factor 1 –partitions 1 –topic test
you can verify if the topic has created successfully in kafka instance using below command
kafka-topics.bat –list –bootstrap-server localhost:9092
you can see topic name test is created in kafka
Note:Zookeeper runs on 2181 and Kafka run on 9092 default port number