A message queue holds work for consumers to retrieve and process later. By moving noncritical or slow work out of a synchronous request, it lets the user-facing task finish without waiting for every service. section 6.8.4 section 7.3.4
Choose a queue when a job should be done once, not broadcast to every service:
- A producer adds a message; one consumer from a worker pool takes it. This distributes work such as image resizing or order processing. section 7.4.1
- Use a topic instead when multiple services each need a copy of an event. section 7.4.1
Print the label later
An order can be checked and paid for synchronously while its shipping-label task waits in a queue. If the shipping service is unavailable, the order need not fail just because label printing cannot happen immediately. section 6.8.4
Figure 7.9 Queues vs. Topics. In a Queue model, Competing Consumers load-balance tasks across multiple workers, ensuring that each message is claimed and processed by only one worker (1-to-1). In contrast, a Topic acts as a prism using a Fan-Out (Pub/Sub) approach to broadcast and duplicate a single event (1-to-Many). This allows multiple distinct services (such as Shipping, Email, and Analytics) to receive their own copies of the event and react to it independently.

Compare one-to-one queue processing with one-to-many topic broadcasting. section 7.4.1


