How it works: the CICS-MQ adapter

The CICS®-MQ adapter is supplied with CICS and communicates with IBM MQ as an external resource manager using the CICS Resource Manager Interface (RMI). CICS and the CICS-MQ adapter share the same address space. The IBM® MQ queue manager runs in its own address space.

Figure 1 shows the relationship between CICS, the CICS-MQ adapter, and IBM MQ.

Part of the adapter is a CICS task-related user exit called DFHMQTRU that communicates with the IBM MQ message manager. CICS management modules call the exit directly; application programs call it through the supplied API stub program (CSQCSTUB). For more information about task-related user exits and stub programs, see Task-related user exit programs.

DFHMQTRU runs on a CICS open tcb. When the CICS-MQ connection is started, DFHMQTRU is enabled using the REQUIRED option (but without the OPENAPI option, thereby meaning CICSAPI) on the ENABLE PROGRAM command during connection processing. This enables it to receive control on any type of key8 open TCB (an L8 or X8 or T8 TCB). Typically its an L8 TCB, but an X8 TCB is used for MQI calls from xplink C programs, and a T8 TCB used for JMS calls from a Java program. Application programs running on open TCBs benefit from CICS not having to switch TCBs to call IBM MQ. For example a threadsafe cobol application running on an L8 TCB that issues an MQI call will invoke DFHMQTRU which also runs on the same L8 TCB and calls IBM MQ. When the request is complete control returns to the application on the same L8 TCB. Whereas a quasirent cobol program runs on the CICS QR TCB. MQI requests are executed under an L8 TCB, so CICS switches to and from the CICS QR TCB and an L8 TCB for each MQI request, which is a performance overhead.

CKTI is the CICS-MQ trigger monitor. It starts a CICS transaction when an MQ trigger message is read. Each CKTI transaction is usually in an MQGET WAIT state, ready to respond to any trigger messages that are placed on its initiation queue.

The adapter management interface provides the operation and control functions described in Administering the CICS-MQ adapter.
Figure 1. How CICS, the CICS-MQ adapter, and an IBM MQ queue manager are related
A diagram illustrating the relationship between CICS, the CICS-MQ adapter, and the IBM MQ subsystem. The CICS task initiation transaction flows through the CICS task-related user exit, and on to the IBM MQ subsystem's message manager, as do CICS application programs, CICS sync point manager, CICS task manager, and CICS termination flows. In a separate flow, the CICS PLT startup program sends a CKQC transaction through the CICS Adapter and onto the IBM MQ subsystem's connection manager.

The CICS-MQ adapter display function uses two main temporary storage queues for each calling task to store the output data for browsing. The names of the queues are ttttCKRT and ttttCKDP, where tttt is the terminal identifier of the terminal from which the display function is requested. Do not try to access these queues.

The CICS-MQ adapter uses the name DFH.genericapplid(8).QMGR to issue CICS ENQ and CICS DEQ calls during processing; for example, starting and stopping the connection. Do not use similar names for CICS ENQ or DEQ purposes.