Demo project for ordering stuff with a simple Ordering Saga utilizing Camunda Platform 7 to take into account possible compensations in case ordering process fails mid-step.
Note that the newest version is Camunda 8, however Camunda 7 is open-source, while Camunda 8 is closed-source cloud-based SaaS solution.
- By Maxym Mykhalchuk, see license
- Built on Spring Boot 3 / Spring Framework 6
- REST microservices (no CQRS/Event-Sourcing)
- Uses MongoDB as storage
- Start MongoDB locally on port 27017 with no password
- For example, using docker
docker run --env=MONGODB_REPLICA_SET_MODE=primary --env=ALLOW_EMPTY_PASSWORD=yes -p 27017:27017 --name demo6-mongodb -d bitnami/mongodb:latest
- To remove,
docker stop demo6-mongodb
anddocker rm demo6-mongodb
- For example, using docker
- Then start all the services
./gradlew bootRun --parallel --max-workers 3
- Open the services
- Inventory Service
- Payment Service to see remaining user credit
- Main Order Service to create orders and employ the Saga that uses Camunda Platform 7
- Open Saga monitoring using Camunda
- Open Camunda Cockpit with user
demo
and passworddemo
- And click 'Order Workflow'
- Open Camunda Cockpit with user
- Order anything via Order Service
- Observe decreased user credit in Payment Service
- Then, after some time, Saga will fail on the last step, and user credit will be restored