Demo: the order saga, happy path
On This Lesson 3 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
build and run the orchestrated order saga. Prepares MID-031-LAB1.
Draft outline details
Step by step
- Show the saga table and the
OrderSagastate machine insideorders. POST /orderscreates the orderPENDINGand a saga row, and writes aReserveStockcommand via the outbox.inventoryrepliesStockReserved; the orchestrator moves toSTOCK_RESERVEDand sendsAuthorizePayment.- Planned mistake: handle
StockReservedwithout checking the current state; replay the reply and the saga re-sends the payment command. Fix: ignore replies unless the state matches, plus inbox dedup. paymentsrepliesPaymentAuthorized; order becomesCONFIRMED, sagaCOMPLETED.- Show the trace by correlation id across the three services.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.