Posts

Showing posts from January, 2016

Running Apache Kafka in Windows

Windows Kafka Setup steps: 1) Download Kafka and unzip. 2) Start Zookeeper: kafka_2.10-0.8.2.1\bin\windows\zookeeper-server-start.bat tools\kafka_2.10-0.8.2.1\config\zookeeper.properties 3) Start Kafka Server kafka_2.10-0.8.2.1\bin\windows\kafka-server-start.bat tools\kafka_2.10-0.8.2.1\config\server.properties 4) List topics, to make sure Kafka is up and running kafka_2.10-0.8.2.1\bin\windows\kafka-topics.bat --list --zookeeper localhost:2181 5) Create new Topic, examples: kafka-topics.bat --create --topic sensor1 --replication-factor 1 --zookeeper localhost:2181 --partition 5 6) Produce some sample Kafka Messages: kafka_2.10-0.8.2.1\bin\windows\kafka-console-producer.sh --broker-list localhost:9092 --topic sensor1 6) Consumer to Test whether above produced messages are successfully published to Kafka broker: kafka_2.10-0.8.2.1\bin\windows\kafka-console-consumer.bat --zookeeper localhost:2181 --topic sensor1 --from-beginning 7) Stop Kafka Server: tools\kafka_2.