Adding a new order search module
Now that we are publishing the application state as it changes, we can consider new functionality that might have been impossible before or would have been too dependent on others to be feasible.
We will be consuming many different sources to keep a local cache to provide greater detail for our search results. Customer, store, and product names will all be stored locally. The new module will be consuming every message that the Order Processing module will be publishing to keep results current. Other data could also be included later, such as the status of the invoice, or the status of the shopping that takes place after the order has been submitted.
Figure 7.13 – The data that feeds the Search module
We will create the new module in a new directory called /search
, and in that directory, we will create the module.go
file exactly like the other modules. This new module will need the following driven adapters in the composition...