A message broker lets services exchange information without connecting directly. A sender posts a message; the broker routes it to a receiver, which reads the data, performs its work, and then removes or marks the message as processed. This supports asynchronous work across independently running services. section 7.0
Two common delivery patterns serve different needs:
- Queue-based processing usually has one subscriber; a processed message then disappears from the system. section 7.0
- Topic-based processing lets multiple subscribers each receive a copy of a message. section 7.0
Figure 7.1 Message-broker workflows
Compare the queue-based and topic-based message flows. section 7.0
Order placement without waiting for delivery work
When a customer places an order, the application adds a message to a queue to notify a delivery driver. The customer sees a success message immediately while another service handles that work in the background. section 7.1
RabbitMQ is one broker option for this workflow. It uses AMQP and provides asynchronous delivery across services, though production setup can be difficult. Aspire also offers Azure Queue Storage as a messaging component. section 7.1 section 7.0
