Skip to content

Apache-kafka-projects/kafka-Spring-boot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kafka-Spring-boot

This is a spring boot application consisting of two microservices, producer and consumer.

In the Producer microservice, we create a topic called "kafkaExampleTopic" just a series of configurations that help us to quickly and efficiently process the messages that arrive to our cluster.

In the Consumer, it is in charge of listening and receiving the messages emitted by the producer and displaying them through the logger.

Kafka Spring boot APP

As we can see in the figure, we have two consumers that listen to and read the producer's messages.

Execute Kafka

docker-compose up -d

Get kafka container id

docker ps | grep kafka-container | awk '{print $1}'

We ejecute this command to run kafka and zookeeper servers as docker containers using Docker-compose file.

Useful Commands

Create topic into Kafka container

docker exec -it 4f763689a6fe kafka-topics --bootstrap-server localhost:9092 --create --topic example-topic --partitions 1 --replication-factor 1

docker exec -it 4f763689a6fe kafka-topics --bootstrap-server localhost:9092 --create --topic example-topic2 --partitions 1 --replication-factor 1

List all topics

docker exec -it <id-container-kafka> kafka-topics --list --bootstrap-server localhost:9092

Get specific data of topic

docker exec -it <id-container-kafka> kafka-topics --describe --topic example-topic --bootstrap-server localhost:9092

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages