In request-response messaging, a correlation ID is a shared identifier that lets a service match a reply to its request. In Kafka, it is commonly carried in a message header and echoed in the response. section 7.1.2
Matching messages is only part of the design: the response must also reach the service instance that holds the request context. If a consumer fails and another instance takes over its partition, that instance may lack the context needed to process the reply. RabbitMQ uses the same matching principle with a reply queue and correlation ID. section 7.1.2 section 5.3.1
Figure 7.5 Both services participating in the request-response pattern have a producer and consumer container. The request and response are matched using the correlation ID, specified in the message header.
The diagram shows request and response services matching messages through the correlation ID in their headers. section 7.1.2




