Skip to content

HANSANAHERATH/spring-boot-kafka-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

spring-boot-kafka-example

Download apache kafka binary : https://archive.apache.org/dist/kafka/2.8.1/kafka_2.12-2.8.1.tgz

Step1 : Start zookeeper

For start zookeeper open a CMD in kafka downloaded folder and run bellow command.

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

Step2 : Start Apache kafka

Open a new CMD and run bellow command.

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

Step3 : Create a topic with name Test-Topic, that has only one partition & one replica.

Open a new CMD and run bellow command and then send a message.

.\bin\windows\kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic Test-Topic

Step4 : start the consumer which listens to the topic Test-Topic we just created above.

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

#Using Spring boot App

Get Request: http://localhost:9000/publish?message=messages

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages