liveBook · Manning

Message broker

As explained in Building Distributed Applications that Work

A software system that mediates communication among applications or services by sending, receiving, and routing messages.

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
figure

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

How Building Distributed Applications that Work covers it

How deep it goes
Defines broker mediation and message processing, contrasts queue and topic delivery, and sketches an order workflow without setup instructions.
Examples
Illustrates an order message notifying a delivery driver while the customer receives an immediate success response.
What it assumes
Defines brokers and queues from first principles while using an application of independently running services as context.
What you can do after
Apply it via RabbitMQ to hand off order notifications for background processing.
How it connects
Links message queues and asynchronous processing to microservices, RabbitMQ, and Azure Queue Storage.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Distributed Applications that Work. The section links point to the parts of the book it draws on.