← Lessons

quiz vs the machine

Silver1050

System Design

The Request Reply Pattern

Two messages model a synchronous-feeling call over async channels.

4 min read · intro · beat Silver to climb

What it is

The request reply pattern lets a caller send a message and receive a matching response over messaging infrastructure. It models a call without coupling the two parties to a shared connection.

How it works

  • The requester sends a message to a request channel.
  • It includes a reply to address naming where the answer should go.
  • It also includes a correlation id so the reply can be matched to the original request.
  • The replier processes the request and sends the answer to the reply channel.

Why it matters

  • Works across process and network boundaries without tight coupling.
  • The reply channel can be temporary per requester or shared with correlation ids.
  • The requester may block and wait or handle the reply later, keeping it flexible.

The cost is added latency and the need to track outstanding requests. Without a correlation id, a shared reply channel cannot tell two answers apart.

Key idea

Request reply pairs a request channel with a reply channel, using a correlation id to match each answer to its question.

Check yourself

Answer to earn rating on the learn ladder.

1. What lets a shared reply channel match an answer to its request?

2. What does the reply to field specify?