Enterprise Integration Patterns
Messaging Patterns
Messaging Patterns
Correlation IdentifierCorrelation IdentifierMessaging Patterns » Message Construction

My application is using Messaging to perform a Request-Reply and has received a reply message.

How does a requestor that has received a reply know which request this is the reply for?

Each reply message should contain a Correlation Identifier, a unique identifier that indicates which request message this reply is for.

There are six parts to Correlation Identifier:

  1. Requestor — An application that performs a business task by sending a request and waiting for a reply.
  2. Replier — Another application that receives the request, fulfills it, then sends the reply. It gets the request ID from the request and stores it as the correlation ID in the reply.
  3. Request — A Message sent from the requestor to the replier containing a request ID.
  4. Reply — A Message sent from the replier to the requestor containing a correlation ID.
  5. Request ID — A token in the request that uniquely identifies the request.
  6. Correlation ID — A token in the reply that has the same value as the request ID in the request.

... Read the entire pattern in the book Enterprise Integration Patterns

Related patterns:

Remote Procedure Invocation, Message, Selective Consumer, Message Sequence, Messaging, Request-Reply, Return Address

Further reading:

Creative Commons Attribution License

You can reuse the following elements under the Creative Commons Attribution license: pattern icon, pattern name, problem and solution statements (in bold), and the sketch. Other portions are protected by copyright.

Enterprise Integration Patterns book cover

Enterprise Integration Patterns
The classic, as relevant as ever. Over 90,000 copies sold.

Software Architect Elevator book cover

The Software Architect Elevator
Learn how architects can play a critical role in IT transformation by applying their technical, communication, and organizational skills.

Cloud Strategy book cover

Cloud Strategy
Fill the large gap between high-level goals and product details by understanding decision trade-offs.