/spring-boot-kafka-example

A Apache kafka example with Spring boot

Primary LanguageShell

spring-boot-kafka-example

A Apache kafka example with Spring boot. This project requires/depends upon:-

  1. JDK 1.8
  2. Maven
  3. Apache Kafka [2.7.1](https://archive.apache.org/dist/kafka/2.7.1/kafka_2.13-2.7.1.tgz)
  4. Apache Zookeeper (Included with kafka above)
  5. Spring boot

What's included

  1. A spring boot java based producer module
  2. A spring boot java based consumer module
  3. The Apache kafka (including zookeeper) setup
  4. Sample curl to send a message from producer to consumer

How to Run

  1. Copy the contents of "kafka" to C:
  2. Use the commands to run apache kafka located [here](https://github.com/iamnav/spring-boot-kafka-example/blob/main/kafka/Run%20commands.txt)
  3. Start the Producer (Port 8081) and Consumer (Port 8082) locally
  4. Use the sample curl to verify the messaging

Producer publish curl

curl --location --request POST 'localhost:8081/kafka/publish' \ --header 'Content-Type: application/json' \ --data-raw '{ "name": "Bob", "dept": "IT", "salary": 12345 }'