Implementation of the Create Order Saga Execution Coordinator
Explore how to implement the Create Order saga execution coordinator in an event-driven architecture using Golang. Learn to define saga data models, set up repositories, and design saga steps including actions and compensations. Understand how a saga orchestrates commands and replies across multiple modules to manage distributed workflows effectively.
Creating an order in the Order Processing module is triggered by the BasketCheckOut event. We can continue to do that in Order Processing. In this lesson, we will be implementing the saga in a new module called cosec that will be reactive to the OrderCreated event from the Order Processing module.
Why not trigger the saga off the BasketCheckedOut event?
We could have and it would work mostly the same with maybe an additional step or alternate action or two. We will leave reimplementing the saga that way as an exercise for you.
Registering all the external types
The saga will be sending commands and receiving ...