liveBook · Manning

Publish/async response

As explained in Microservices Patterns, Second Edition

An interaction style in which a client publishes a request and receives responses asynchronously from interested services.

Publish/async response is a one-to-many, asynchronous interaction: a client publishes a request, and interested services can respond without requiring the client to block. Messaging alone does not make an interaction asynchronous; a client may still block while waiting for a reply. section 8.1.1 section 8.1.1

Table 8.1 The various interaction styles can be characterized in two dimensions: one-to-one vs one-to-many and synchronous vs. asynchronous

one-to-one

one-to-many

Synchronous

Request/response

-

Asynchronous

Asynchronous request/response

One-way notifications

Publish/subscribe

Publish/Async responses

Use the interaction-style matrix to compare publish/async response with other one-to-many and asynchronous styles. section 8.1.1

The client publishes a message to a publish/subscribe channel and includes a reply-channel header. A consumer sends a reply to that channel with a correlation ID; the client uses the ID to match replies to its request. section 8.3.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

The figure illustrates a request carrying a reply channel and message identifier, followed by a reply to that channel. section 8.3.2

How Microservices Patterns, Second Edition covers it

How deep it goes
Defines the interaction and specifies reply-channel and correlation-ID mechanics, without detailing broader message-architecture design.
Examples
Uses a published request, reply-channel header, and correlation-ID-matched replies to illustrate the interaction.
What you can do after
Apply it via messaging by publishing requests with reply-channel headers and matching replies by correlation ID.
How it connects
Combines publish/subscribe with request/response over messaging.

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.