liveBook · Manning

Reply message

As explained in Microservices Patterns, Second Edition

A message communicating the result of processing a prior request or command message.

A reply message communicates the outcome of processing a command. In asynchronous request/response, the service sends it to a reply channel identified by the client. section 8.3.1 section 8.3.2

To route and match replies:

  • Include a reply-channel header in the command so the service knows where to send its reply. section 8.3.2
  • Put a correlation ID in the reply; the client uses it to match the reply 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

Shows a command carrying the reply channel and message identifier used to return and match the reply. section 8.3.2

Order validation

The Consumer Service returns a ConsumerValidated reply to the Order Service; the Restaurant Service returns OrderDetailsValidated. The Order Service uses these outcomes to validate the order asynchronously. section 8.3.9

How Microservices Patterns, Second Edition covers it

How deep it goes
Explains reply routing through a reply channel and request matching through a correlation ID.
Examples
Uses ConsumerValidated and OrderDetailsValidated replies during asynchronous order validation.
What it assumes
Assumes familiarity with messages and channels while defining commands as operation requests and replies as their outcomes.
What you can do after
Apply asynchronous request/response by routing replies to a client channel and matching them to requests with correlation IDs.
How it connects
Connects command messages, asynchronous request/response, point-to-point channels, and correlation identifiers.

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.