Bewerken

Delen via


Correlating Messages with Request-Reply

There are two ways to correlate messages in BizTalk Server orchestrations for MQSeries request-reply scenarios. The first is to supply the correlation identifier by setting both the MessageID (MQMD_MsgID) and the CorrelationID (MQMD_CorrelationID) to the same value. The second is to use the BizTalk_CorrelationId context property.

When sending the message to an MQSeries Queue Manager, you can set the message identifier (MQMD_MsgID) and the correlation identifier (MQMD_CorrelationID) to the same value in the outgoing message. The MQSeries Queue Manager copies the MessageID to the CorrelationID for the reply message. You can initialize the correlation sets for the outgoing message and follow the correlation sets for the incoming message using the value of MQMD_CorrelationID.

Alternately, instead of setting the MessageID and CorrelationID to the same value in the outgoing message, you can use the BizTalk_CorrelationID context property with a solicit-response send port of BizTalk Adapter for MQSeries.

To use identifiers provided by MQSeries Server for correlations in your BizTalk orchestration, BizTalk Server must first obtain the identifier. Your application does this through a solicit-response request. BizTalk Server sends a solicit-response request using MQSC Adapter to the MQSeries Server. In return, it receives a response with the message identifier (MQMD_MsgId) and the correlation identifier (MQMD_CorrelationId).

For the outgoing message in a solicit-response send port, the adapter copies the MQMD_MsgID generated by MQSeries to the MQSeries.BizTalk_CorrelationId context property.

When receiving messages, the adapter copies the MQMD_CorrelationId to the MQSeries.BizTalk_CorrelationId. In this case, using correlation sets, you can initialize the correlation sets for the outgoing message and follow the correlation sets for the incoming message using the MQSeries.BizTalk_CorrelationId.

See Also

Client-Based BizTalk Adapter for WebSphere MQ Programmer's Guide