Message Correlator for WebSphere MQ: request-response without persistence pattern

Use the Message Correlator for WebSphere MQ: request-response without persistence pattern to accept requests from many client applications on a single queue, and to return responses to the correct client by using non-transactional flows and non-persistent WebSphere MQ messages.

Because this pattern uses non-persistent messages and non-transactional flows, it is not appropriate to use this pattern when the message interchanges updated results that require no loss of data.

This flow must be used for requests for information, where faster performance is more important than ensuring no loss of data.

A diagram showing the behavior of the pattern. A number of requesting applications send messages to the broker. The reply address of the requester is stored before the message is forwarded to the provider and re-stored when a response is received from the provider.

Solution

The solution is to implement a mediation flow that stores the MQMD header information from each request message, indexed by 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. The provider application is expected, in accordance with conventional practice, 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.

Request flow
Response flow
Error subflow
Log subflow

Related tasks

Read the following section for information about how to apply and use this pattern.

Constraints on the use of the pattern
Tasks to complete before applying the pattern
Parameters for the pattern
Tasks to complete after generating the pattern