This is a demo multi-module Maven project implementing a Saga Orchestration pattern using Spring Boot and Apache Kafka.
kafka-common— shared event classes & topic namesorchestrator-service— exposes REST/api/ordersto start a saga and coordinates via Kafkaorder-service— tracks order status (in-memory)inventory-service— simple in-memory stock, reserves/releasespayment-service— mock paymentshipping-service— mock shipping
- Start Kafka locally on
localhost:9092(e.g., Confluent Platform or Docker). - Build:
mvn -q -DskipTests package - In separate terminals, run each service:
mvn -pl orchestrator-service spring-boot:runmvn -pl order-service spring-boot:runmvn -pl inventory-service spring-boot:runmvn -pl payment-service spring-boot:runmvn -pl shipping-service spring-boot:run
curl -X POST "http://localhost:8080/api/orders?userId=u1&itemName=item&quantity=1&amount=100"Check order statuses:
curl "http://localhost:8081/orders"Check inventory snapshot:
curl "http://localhost:8082/inventory"