Refactoring to asynchronous communication
In the last chapter, we published messages from the Store Management module to the Shopping Baskets module. We focused on creating the mechanisms between the modules and had only logged to the console when a message arrived. What we started in that chapter was adding new inputs and outputs to the modules:
Figure 7.1 – New message inputs and outputs
We will be adding entirely new asynchronous APIs to the modules to implement the sharing of state via events: event-carried state transfer. Also, it would be an excellent time to reflect on the data each module is sharing with its existing gRPC API. We will be trying to determine what data other modules need to know about to function and where that data originates from.
Store Management state transfer
The Store Management module shares Store
and Product
information with the other modules. It is the origin of all Store
and Product
data in our application. However...