Making the Store Management Module Asynchronous
Explore how to update the Store Management module to publish integration events.
We are going to update the Store Management module to publish integration events and will also update the Shopping Baskets module to receive messages. The Shopping Baskets module will not be doing much more than logging the receipt of the message.
Modifying the monolith configuration
Starting with a simple configuration for NATS, we need a uniform resource locator (URL) to connect to and a name for our stream. Of course, both could be hardcoded or put into variables in the code, but we run the application from a Docker container and without. The stream name is used in a few places, so having it be part of the configuration for the application is the lazy option. The code is illustrated here:
Get hands-on with 1400+ tech skills courses.