Matching messages with replies
If the engine is configured to await replies, then there are four ways to
match an outgoing message with its incoming reply. The outgoing message is written to
the outbound queue. The reply is written to the reply-to queue as specified under
MQMD
in the Network Configurator.
Matching methods depend upon the Report member of MQMD
:
- If Report equals
MQRO_NONE
, then the first message found in the reply-to queue is processed as the reply. - If Report equals
MQRO_PASS_MSG_ID
, then the MsgID field of the outgoing message is compared to the MsgID of the reply.If they match, then the reply is processed.
- If Report equals
MQRO_PASS_CORREL_ID
, then the CorrelID of the outbound message is compared to the CorrelID of the reply. - If Report is set equal to
MQRO_COPY_MSG_ID_TO_CORREL_ID
, then the reply is processed if its CorrelID matches the MsgID of the outbound message.
For reply queues, you must specify one of these MQRO
report
options:
MQRO_PASS MESSAGE_ID
MQRO_PASS_CORRELATION_ID
MQRO_COPY_MESSAGE_ID_TO_CORRELATION_ID
This controls how inbound reply messages are matched up with outbound
messages. One and only one of these three options can be specified. Other
MQRO
options can be included.
The name of a reply-to queue must be specified in MQMD
if the
engine is configured to await replies. This queue is not necessary, but must be named.
- If the queue does exist when the system is run, then this queue is used for replies.
- If the queue does not exist, then a
Cloverleaf.MODELQ
model queue is created and used as a template. This happens if a model queue is not specified under the outbound queue parameters. This template create a permanent dynamic queue to handle replies. - Sometimes, the reply-to queue does not exist, and a model queue is specified under the outbound queue parameters. When this happens, the attributes of this model queue are used to create a dynamic queue to handle replies.