Managing MsgId and CorrelId in a unit of work (DPL)

If your bridge application is running a single DPL program, set the value of MQCIH.UOWControl to MQCUOWC_ONLY. However, if your application is sending and receiving multiple messages, you must handle units of work correctly for the CICS(R) DPL bridge. If you want to run multiple user programs within a unit of work, set:

Your application can send multiple request messages within a unit of work before receiving any response messages. At any time after the first message, you can terminate the unit of work by sending a message with MQCIH.UOWControl set to MQCUOWC_COMMIT or MQCUOWC_BACKOUT.

The following diagram summarizes the values to use and expect in key fields in the MQMD and MQCIH in typical CICS DPL bridge applications.

The first message must specify MQMD.CorrelId = MQCI_NEW_SESSION and subsequent messages must set MQMD.CorrelId to the message Id of the first message.

In Figure 16, running more than one user program using the DPL bridge, the MsgId of the request message is set by the queue manager (to M1), and subsequently copied to the CorrelId.

Figure 16. Setting of key fields for many CICS user programs in a unit of work viewed from the perspective of the bridge
 Setting of key fields for many CICS user programs in a unit of work using the DPL bridge  The diagram shows the interaction between a WebSphere MQ application and the CICS bridge:   Application request message 1   UOWControl=MQCUOWC_FIRST CorrelId=MQCI_NEW_SESSION Application does MQGET MsgId=M1  Values set by bridge are:   MsgId=M1 CorrelId=M1 Application request message 2   UOWControl=MQCUOWC_MIDDLE CorrelId=M1 MsgId=MQMI_NONE Application does MQGET MsgId=M1  Values set by bridge are:   MsgId=M1 CorrelId=M2 Application request message 3   UOWControl=MQCUOWC_LAST CorrelId=M1 MsgId=MQMI_NONE Application does MQGET MsgId=M1  Values set by bridge are:   MsgId=M1 CorrelId=M3