Simple Example of Microservices with Event-Driven Architecture with Multiple Consumers.
🔔 Event-Driven Microservices using Spring boot and Kafka.
🔔 Asynchronous communication.
🔔 Message/Event Producer subscribed.
🔔 Two Message/Event Consumers subscribed.
-
Java 17+
-
Spring boot
-
Microservices
-
Kafka
-
Maven
-
Intellij Idea
-
Postman
-
Swagger
1. Clone the application.
git clone https://github.com/SergioRuyDev/springboot-kafka-microservices.git
2. Use the terminal to go inside of the folder kafka_2.13-3.3.1 and run in two diferents tabs, the commands below.
bin/zookeeper-server-start.sh config/zookeeper.properties
bin/kafka-server-start.sh config/server.properties
3. In your prefered IDE run in sequence as a Java application the classes below.
OrderServiceApplication
StockServiceApplication
EmailServiceApplication
4. Use the Postman for test the POST Request.
POST - URL - http://localhost:8080/api/v1/orders
Body Example
{
"orderName": "Notebook",
"qty": 1,
"price": 4000
}
Response - 200 Ok - Order placed successfully...