This project demonstrates a Spring Boot-based microservice architecture with synchronous communication using Feign clients.
- Manages product stock levels
- Exposes
/inventory/check
to 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