Produce & Consume String Messages using Apache Kafka and Java
In this post, we will create a Kafka producer which will produce string messages as Rest call and a consumer which will consume the produced messages. Install/Setup Kafka To download Kafka refer to the Apache Kafka Download website . Pick any of the desired package. For this post we choose 2.8.1 Scala 2.12 - kafka_2.12-3.0.0.tgz ( asc , sha512 ) NOTE: The version 2.13.3 is not working and will throw Connection Refused error. Steps to Setup: Extract the tgz file to some directory. Open zookeeper.properties file under config directory and provide the dataDir value. It is the data directory used by Kafka to store the data. Open server.properties file under config directory and provide the logs-dir kafka logs directory. Start the zookeeper by running following command: if Windows: .\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties if Unix: .\bin\zookeeper-server-start.sh .\config\zookeeper.properties NOTE: Problem: If you are gettin