liveBook · Manning

Asynchronous request

As explained in Microservices Patterns, Second Edition

An interaction style in which a requester sends a request and later receives a response without blocking for an immediate result.

Asynchronous request/response lets a client send a service request without waiting for an immediate reply. Unlike synchronous request/response, it does not require the client to block while the service processes the request. section 8.1.1 section 8.3

When implemented with messaging, the exchange works as follows:

  • The client sends a command containing the operation and parameters to a point-to-point channel owned by the service. section 8.3.2
  • The request identifies a reply channel; the service sends the outcome there with a correlation ID that lets the client match the reply to its request. section 8.3.2
  • The client normally handles replies asynchronously, though it could block until a reply arrives. Messaging alone does not guarantee that a client avoids blocking. section 8.3.2

Create Order saga

An Order Service orchestrator sends commands to saga participants and receives their replies through message channels. This applies asynchronous request/response to coordinate a multi-step system command while maintaining responsiveness. section 11.4 section 11.1.2

Figure 8.13 Implementing asynchronous request/response by including a reply channel and message identifier in the request message. The receiver processes the message and sends the reply to the specified reply channel.
RequestReply

Use the message-flow diagram to see how a request supplies a reply channel and message identifier for the response. section 8.3.2

How Microservices Patterns, Second Edition covers it

How deep it goes
Explains command and reply channels, reply-channel headers, and correlation IDs, while stopping short of a full low-level implementation.
Examples
Uses the Create Order saga, where an Order Service orchestrator exchanges commands and replies with participants.
What it assumes
Builds on client-service interaction styles and messaging, distinguishing whether the client waits for a reply.
What you can do after
Apply the pattern by sending commands to service channels and routing replies back with correlation IDs.
How it connects
Connects messaging and point-to-point channels with service interaction styles and saga orchestration.

Also explained in

Compare how 2 books explain asynchronous request →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Microservices Patterns, Second Edition. The section links point to the parts of the book it draws on.