This Spring Boot project is a microservices architecture that utilizes various technologies such as Java Spring Boot, Kafka, Eureka, MongoDB, and PostgreSQL. The project consists of six different microservices:
- Product Service
- Order Service
- Inventory Service
- ApiGateway Service
- Discovery Server
- Notification Service
The primary functionality involves handling product details, managing orders, tracking inventory, routing through the API Gateway, service discovery with Eureka, and sending notifications using Kafka.
- Description:
- Manages product details.
- Endpoints:
- GET:
/api/product- Retrieve product information. - POST:
/api/product- Store product data in MongoDB.
- GET:
- Description:
- Handles order creation and communicates with the Inventory Service using async communication and circuit breaker.
- Endpoints:
- POST:
/api/order- Create an order with a list of items. Internally communicates with the Inventory Service.
- POST:
- Database:
- PostgreSQL for order data.
- Description:
- Manages inventory and handles async communication from the Order Service.
- Endpoints:
- GET:
/api/inventory- Return whether a item is in stock or not.
- GET:
- Database:
- PostgreSQL for inventory data.
- Description:
- Routes requests to different services (Product, Order, etc.).
- Description:
- Eureka service registry for service discovery.
- Description:
- Handles notifications, particularly sending emails after successful order creation.
- Communication:
- Receives events from the Order Service via Kafka.
- Notification Method:
- Sends emails or processes order ID.
Follow these steps to set up and run the microservices on your local environment:
- Run
mvn clean verify -DskipTestsby going inside each folder to build the applications. - After that run
mvn spring-boot:runby going inside each folder to start the applications.
This project was inspired by and built following the tutorial from Spring Boot Microservice Project. Feel free to check out the tutorial for more in-depth explanations and insights.
