Back to Catalog
Integration
Message Construction
Correlation Identifier
Tag every request with a unique ID so you can match its reply later.
Intent & Description
Real-world Use Case
API gateway sends 100 concurrent PriceCheck requests to a pricing service. Each has a unique correlationId. Replies arrive out of order (async). Gateway matches each reply to the waiting HTTP request via correlationId map. All 100 responses correctly delivered.
Source
📌 TL;DR
Correlation Identifier = UUID in the request, echo it in the reply. Match responses to requests like a waiter remembering which table ordered what.
Advantages
- Essential for concurrent async request-reply flows
- Enables out-of-order reply matching
- Works across multiple reply channels and partitions
- Standard pattern — supported natively in most broker headers
Disadvantages
- Requires unique ID generation (UUID — cheap but needs to be truly unique)
- In-memory correlation map leaks if replies never arrive — needs TTL/cleanup
- Adds overhead to every message
- IDs must be propagated correctly through every hop (easy to lose in complex pipelines)