Orchestrated sagas: Camel Saga and Quarkus Flow
One order-service that runs the same order saga under a Camel Saga with an LRA coordinator and under a Quarkus Flow workflow, over the same inventory and payment participants, with a payment service that stops answering.
examples/23-orchestrated-sagas/ runs one order flow, order then stock then payment, under two orchestrators in order-service. inventory-service and payment-service take commands over Kafka and join the Camel saga when the command carries its header. It accompanies Orchestrated sagas: Camel Saga and Quarkus Flow.
It uses Quarkus with Quarkus REST, Camel Kafka, the Camel Saga EIP with the LRA binding, Quarkus Flow, Flyway, the Debezium outbox and Connect, SmallRye Health, PostgreSQL, Kafka, a Narayana LRA coordinator and OpenTelemetry to the LGTM stack.
(cd examples/domain-model && mvn -B -q install)
cd examples/23-orchestrated-sagas
mvn -B verify
./verify.sh
What to observe
- Same inputs, same terminal states. Both orchestrators end PAID for a payment that is accepted and CANCELLED, with the stock released and one OrderCancelled, for one that is declined.
- Two kinds of saga state. The Camel saga is an entry at the coordinator and a header on each record. The workflow is a row in PostgreSQL that disappears when the instance completes.
- A payment service that does not answer. The coordinator cancels the Camel saga and the late payment cannot join, so none is taken. The workflow times out and the late payment is taken and then refunded.
- A recreate with sagas in flight. The Camel saga completes through its header. The waiting workflow instance does not resume.
Infrastructure
Kafka, PostgreSQL, Connect, the LGTM stack and the LRA coordinator from examples/_infra, plus three services. The compose project is edp-23.