This project demonstrates a Spring Boot-based microservice architecture with synchronous communication using Feign clients.
- Manages product stock levels
- Exposes
/inventory/checkto validate availability
- Handles item creation and retrieval
- Uses Feign to call Inventory Service before saving an item
Order Service (Feign Client) β βββββΆ Inventory Service /inventory/check?product=fridge&qty=2
+-------------------+ Feign Client +----------------------+ | | ββββββββββββββββββββββββΆ | | | Order Service | | Inventory Service | | (demo) | ββββββββββββββββββββββββ | (inventory-service) | | | Stock Response | | +-------------------+ +----------------------+
User β /items (POST) β Order MS β checks stock β Inventory MS β 400 if out of stock, else saves item
# Inventory Service
cd inventory-service
mvn spring-boot:run -DskipTests
# Order Service
cd demo
mvn spring-boot:run -DskipTests
π§ Tech Stack
Spring Boot
Spring Cloud OpenFeign
REST APIs
Maven