-
Event-Driven Architecture
-
Domain Driven Design (DDD)
-
SAGA Pattern ( Distributed transaction ): process & rollback ( compensating transactions )
-
Outbox Pattern: Avoid dual-writes, no 2PC required using
Kafka
,Kafka Connect
,Debezium
,Outbox Event Router
-
Kafka Messaging Systems for SAGA Orchestration
-
Outbox CDC to kafka topics (Debezium)
Service name | Endpoint |
---|---|
Order service | localhost:8084 |
Customer service | localhost:8085 |
Payment service | localhost:8086 |
Inventory service | localhost:8087 |
Shipment service | localhost:8088 |
Discovery service | localhost:8089 |
- Framework: Quarkus 3.5.2
- Language: Java 17
- Build Tool: Gradle
docker-compose up -d
./gradlew
Create outbox connectors
sh register-connectors.sh
Delete all connectors
sh delete-connectors.sh
Register a new customer with credit
Set an inventory stock
Customer uses its own account credit to finalize an order
Events - CustomerCreated · ProductRegisteredInStock · (Saga Run) OrderCreated · ProductStockReserved · PaymentRequested · CustomerCreditReserved · PaymentCompleted · ShipmentRequested
e2e-test/customer-uses-account-credit.sh
Register a new customer with credit
Set an inventory stock
Customer exceeds its own account credit to finalize an order
Order is rejected
Events - CustomerCreated · ProductRegisteredInStock · (Saga Run) OrderCreated · ProductStockReserved · PaymentRequested · CustomerCreditLimitExceededEvent · PaymentCancelled · ProductStockRelesed · OrderRejected
e2e-test/customer-exceeds-account-credit.sh
Register a new customer with credit
Set an inventory stock
Product is out of stock
Order is rejected
Events - CustomerCreated · ProductRegisteredInStock · (Saga Run) OrderCreated · ProductOutOfStock · OrderRejected
e2e-test/product-out-of-stock.sh