Skip to content

rednavis/kafka-spring-boot-demo

Repository files navigation

This is a project to demonstrate a basic Kafka-Spring Boot integration.

Submodules pipeline build status:

  • Message Producer Build Status
  • Message Processor Build Status
  • Message Consumer Build Status

Initial application structure and flow

Image of Flow

Message producer provides api (see Swagger)

How to start project

  • Clone the project with submodules using following command
git clone --recurse-submodules [email protected]:rednavis/kafka-spring-boot-demo.git 
  • Run these commands to create a network and run Kafka and Zookeeper in docker containers.
docker network create kafka
 
docker run -d --net=kafka --name=zookeeper -e ZOOKEEPER_CLIENT_PORT=2181 confluentinc/cp-zookeeper:5.0.0
docker run -d --net=kafka --name=kafka -p 9092:9092 -e KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092 -e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 confluentinc/cp-kafka:5.0.0
  • If you can’t connect, add this line to /etc/hosts to ensure proper routing to container network “kafka”
127.0.0.1 kafka
  • Start messaging platforms with docker start command
docker start zookeeper
docker start kafka
  • Start submodules by calling ./mvnw spring-boot:run in each module.

Swagger

After starting message-producer you can find Swagger UI page at localhost:57300/demo/api/swagger-ui.html

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published