Message queuing moves work off the request-response critical path. Producers submit work for consumers to handle asynchronously, so each can operate at its own pace instead of forcing a user-facing request to wait for every downstream system. section 5.3.5
Use a queue when an operation does not need an immediate response. After an e-commerce purchase, payment validation and order confirmation remain on the critical path; inventory updates, warehouse notifications, email, and analytics can run afterward. This can return confirmation in 200ms rather than delaying the user for several seconds. section 5.3.5 section 5.6
Choose the messaging model by how consumers need to access messages:
- Use a traditional queue such as RabbitMQ for task distribution: one consumer processes an enqueued job and the message is removed. Suitable jobs include image processing, report generation, and notification delivery. section 5.3.5
- Use an event-streaming platform such as Kafka when multiple consumers must independently read the same event or when replay is needed. Kafka retains messages in an append-only log, allowing consumers to process at their own pace or replay events after failures. section 5.3.5
Separate confirmation from downstream work
A purchase flow should confirm payment and the order before responding. Queue inventory synchronization, warehouse notification, email delivery, and analytics events so slow downstream systems do not extend the user-visible transaction. section 5.3.5
Message queues are an architectural performance choice, not a late code-level optimization. They reduce user-facing latency by separating critical work from background processing while avoiding tight coupling between producing and consuming services. section 5.0 section 5.6


