Skip to content

Demo of two Spring microservices communicating through Kafka message broker

Notifications You must be signed in to change notification settings

m-remis/spring-kafka-producer-consumer-demo

Repository files navigation

CircleCI

Spring kafka producer - consumer demo

Two Simple Spring Boot demo applications (producer - consumer) that utilize Kafka message broker

This project uses:

  • Java 17
  • Maven
  • Spring Boot 3 framework
  • Kafka

This is multi-module project

Producer and consumer are spearate microservices, third module contains just common dto used for messages

Project utilizes dependency management with parent

Make sure to have installed

Git

JDK 17 or later

Maven 3.8.8 or later

Docker

Before starting

Build & test

mvn clean install

Start dependencies in docker containers

docker-compose up -d

Start consumer microservice

java -jar kafka-producer-consumer-demo\kafka-consumer\target\kafka-consumer.jar

Start producer microservice

java -jar kafka-producer-consumer-demo\kafka-producer\target\kafka-producer.jar

"Hold your horses you magnificent beast, how the fuck do I know it if works ?"

Glad you asked, this fine piece of machinery can be observed through the magic of glorious technology called logging

Producer will produce logs every 5 seconds

yo-mama

Consumer will consume them and log them

yo-papa

TODO: Unit tests with test containers integration

About

Demo of two Spring microservices communicating through Kafka message broker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages