Home > Design Patterns > Asynchronous Queuing
Asynchronous Queuing

Asynchronous Queuing (Little, Rischbeck, Simo)

How can a service and its consumers accommodate isolated failures and avoid unnecessarily locking resources?

Problem

When a service capability requires that consumers interact with it synchronously, it can inhibit performance and compromise reliability.

Solution

A service can exchange messages with its consumers via an intermediary buffer, allowing service and consumers to process messages independently by remaining temporally decoupled.

Application

Queuing technology needs to be incorporated into the surrounding architecture, and back-up stores may also be required.

Impacts

There may be no acknowledgement of successful message delivery, and atomic transactions may not be possible.

Architecture

Inventory, Composition

Listen to the podcasts that accompany this site

Asynchronous Queuing: Service A sends a message to Service B, which is intercepted and stored by an intermediary queue (1). The queue the forwards the message to Service B (2), and while Service B is processing the message, Service A remains released from memory (3).

Service A sends a message to Service B, which is intercepted and stored by an intermediary queue (1). The queue the forwards the message to Service B (2), and while Service B is processing the message, Service A remains released from memory (3).

Asynchronous Queuing: After completing its processing, Service B issues a response message back to Service A, which is also received and stored by the intermediary queue (4). Service A receives the response (5) and completes processing of the response, all the while Service B is deactivated (6).

After completing its processing, Service B issues a response message back to Service A, which is also received and stored by the intermediary queue (4). Service A receives the response (5) and completes processing of the response, all the while Service B is deactivated (6).