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.
The figure illustrates a request carrying a reply channel and message identifier, followed by a reply to that channel. section 8.3.2
