https://github.com/mark1708/spring-boot-kafka-example
This is a simple project made for educational purposes in order to learn how to communicate between microservices using the Kafka message broker.
https://github.com/mark1708/spring-boot-kafka-example
java kafka spring spring-boot
Last synced: 2 months ago
JSON representation
This is a simple project made for educational purposes in order to learn how to communicate between microservices using the Kafka message broker.
- Host: GitHub
- URL: https://github.com/mark1708/spring-boot-kafka-example
- Owner: Mark1708
- Created: 2022-02-13T10:45:03.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-14T13:04:27.000Z (over 4 years ago)
- Last Synced: 2025-08-31T23:51:10.368Z (10 months ago)
- Topics: java, kafka, spring, spring-boot
- Language: Java
- Homepage:
- Size: 45.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# spring-boot-kafka-example
 

>This is a simple project made for educational purposes in order to learn how to communicate between microservices using the Kafka message broker.
## Table of contents
* [General info](#general-info)
* [Technologies](#technologies)
* [Features](#features)
* [Status](#status)
* [Inspiration](#inspiration)
* [Contact](#contact)
## General info
Our application will have the following interaction structure.

The project includes 2 services:
* kafka-consumer
* kafka-producer
To run the project, you need to run Kafka and Zookeeper. To do this, enter the command:
`docker-compose up -d`
To track all sent messages you can enter the command:
`docker exec --interactive --tty broker kafka-console-consumer --bootstrap-server broker:9092 --topic topicName --from-beginning`
Then run kafka-consumer and kafka-producer via IDEA
## Technologies
* Java - version 11
* Spring Boot - version 2.6.3
## Code Examples
### Request
```
POST http://localhost:8080/api/messages
Content-Type: application/json
{
"message": "Some message"
}
```
#### In console of Consumer application you can see:
`Listener received: Some message 🎉`
## Features
* Used Apache Kafka
* Used docker-compose to start Kafka and Zookeeper
## Status
Project is: _finished_
## Inspiration
The project was created for educational purposes
## Contact
Created by [Gurianov Mark](https://mark1708.github.io/) - feel free to contact me!
#### +7(962)024-50-04 | mark1708.work@gmail.com | [github](http://github.com/Mark1708)
