The Depot, Order Processing, and Payments Modules
Explore how to define and implement command messages and handlers across Depot, Order Processing, and Payments modules. Understand the communication flow and orchestration of these modules to manage orders within an event-driven architecture in Golang.
We'll cover the following...
The Depot module
The Depot module has three commands and a reply that we need to define. CreateShoppingList is a slightly interesting protocol buffer message:
message CreateShoppingList {message Item {string product_id = 1;string store_id = 2;int32 quantity = 3;}string order_id = 1;repeated Item items = 2;}
What is interesting is that it is not a copy of the OrderCreated event from the Order Processing module.
First, we do not have a
ShoppingIdthat can be added yet.Second, we don’t need to be generic and include requirements for data we don’t need for a command in the Depot module.
Something that’s maybe not all that interesting but worth pointing out is that we did not copy and paste this message, forcing us to do unnecessary work. ...