liveBook · Manning

Request/reply interaction

As explained in Microservices Patterns, Second Edition

A communication pattern in which a client sends a request and receives a reply from the recipient.

In request/reply interaction, a client sends a request and waits for the service to respond. It suits query-style operations and commands that need immediate confirmation; Remote Procedure Invocation (RPI) commonly supports this pattern. section 8.2.1

Choose this interaction with its operational trade-offs in mind:

  • Direct communication avoids an intermediate message broker, simplifying deployment, operation, and debugging, and can reduce latency. section 8.2.1
  • The client and service must be available and responsive together; failures or high latency can propagate. Resiliency patterns can mitigate these risks. section 8.2.1
  • Request/reply does not naturally support other interaction styles, which may require a message broker or event streaming platform. section 8.2.1

For messaging-based APIs, an AsyncAPI receive operation can specify reply messages, allowing request/reply communication to be modeled. section 8.3.5

How Microservices Patterns, Second Edition covers it

How deep it goes
Defines the interaction and weighs implementation benefits against runtime coupling and limited interaction styles.
Examples
Uses query-style operations, commands needing immediate confirmation, and AsyncAPI receive operations with reply messages.
What you can do after
Evaluate its simplicity and direct-call benefits against runtime coupling and the need for additional infrastructure for other interaction styles.
How it connects
Connects request/reply with Remote Procedure Invocation, synchronous communication, service discovery, resiliency patterns, and message brokers.

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.