Skip to content

Latest commit

 

History

History
45 lines (23 loc) · 1.79 KB

File metadata and controls

45 lines (23 loc) · 1.79 KB

Spring Boot Kafka Basic Producer & Consumer Demo

This demo contains examples of String datatype Producer/Consumer and JSON Object Datatype Producer/Consumer.

Basic Commands to start with Kafka -

  • Step 1 : After download and installing Kafka, To Start the Environment

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

  • Step 2 : To Start the Kafka Broker Service

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

  • Step 3 : To Create a Topic to Store your Events

.\bin\windows\kafka-topics.bat --create --topic your-kafka-topic-name --bootstrap-server localhost:9092

  • Step 4 : To Write some Events to the Created Topic

.\bin\windows\kafka-console-producer.bat --topic your-kafka-topic-name bootstrap-server localhost:9092

> Hello World

> This is Kafka Stream Processing World

  • Step 5 : To Read the Events

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

The Messages will Printed to the Consumer Console

Hello World

This is Kafka Stream Processing World

Image of Spring Boot Kafka Project Flow Diagram

GitHub Repositories by BOUALI Ali & Ramesh Fadatare - Java Guides to Start with -