Use the Message Correlator for WebSphere MQ: request-response with persistence pattern to accept requests from many client applications on a single queue, and to return responses to the correct client by using transactional flows and persistent WebSphere MQ messages.
Because this pattern uses reliable communications with persistent messages and transactional flows, it is appropriate to use when the message interchanges result in updates that requires no loss of data.
The solution is to implement a mediation flow that stores away the MQMD header information from each request message, indexed by a message identifier, before forwarding the message, with all of its headers, to the provider application. This request message to the provider specifies the response queue of the broker in the reply-to part of the message header. In accordance with conventional practice, the provider application is expected to copy the message identifier from the request message into the correlation identifier field of the response message. On receipt of a response message, the broker flow uses the correlation identifier to retrieve the previously stored MQMD header, and uses the reply address to update the incoming MQMD header. This action ensures that the original reply-to address from the requester is used. The response message is then returned to the requester with all of its headers.
Read the following section for information about the design of the message flows in this pattern.