The sold-out event we implemented in Chapter 13, Service Ecosystem Patterns, provides the information on the items that are not available in the catalog. Furthermore, we can consume this event through the use of the BackgroundService type capabilities we described in this chapter. The cart service will implement a sold-out handler that will handle and remove the item IDs that are not available from the Redis instance.
Consuming the sold-out event
Creating a sold-out handler
Let's start by creating a handler that manages the sold-out condition of a product in the cart service. First of all, we should proceed by adding the RabbitMQ.Client package to the Cart.Domain project by executing the following command:
dotnet add...