MQ Trigger Monitors

Top  Previous  Next

XCICS/TS provides an IBM WebSphere MQ CICS Adapter like feature: the MQ Trigger Monitor services. These services act like the mainframe task CKTI: they listen on a MQ initiation queue and activate an user task whenever a message is catch on the initiation queue.

Note: MQ/Trigger monitors are currently not available on Windows systems.

The mechanism

The queue manager (QueueMgr) has three queues defined: CICS01.INITQ, CICS01.IN and CICS01.OUT. The CICS01.INITQ is the initiation queue and it is used by the MQ triggering mechanism (triggering enables the activation of programs when messages arrive on queues). The initiation queue receives trigger messages (created by the queue manager) indicating the event of the arrival of a message on a queue (in this case CICS01.IN). The trigger message has the name of the queue where the message has arrived and the name of the program that needs to be started to process the message.

An MQ object called PROCESS must be defined when triggering is used. The process has the information about of the type and name of the application that is started by the trigger monitor. The name of the process is configured as an attribute of the application queue (CICS01.IN). The process object imust exist and make a reference to the user transaction name to start.

The transaction CKTI (part of the XCICS/TS trigger monitor system) is normally started during CICS startup (or manually using xcicsadm) to monitor the CICS01.INITQ queue. The queue CICS01.IN is configured to generate a trigger message when the first message arrives (trigger first) on the queue and to request the start of a CICS transaction to process messages that arrive on the queue.

CKTI gets trigger messages from the CICS01.INITQ initiation queue and the message has the name of the CICS transaction that is started to process the message. CKTI starts the user transaction and passes a copy of the trigger message. The user transaction receives the trigger message, it finds the name of the queue that has messages waiting to be processed, and it gets the messages and processes them. As result of the process a response is created and put on the reply queue CICS01.OUT.

IMPORTANT: do not define any trigger monitor for the queues that are part of the XCICS/ MQ communication. The CKTI transaction is their trigger monitor.

Example

Queue & Process definition

define qlocal(CICS01.INITQ) REPLACE DESCR('Initialization queue for CICS01')
define qlocal(CICS01.IN)    REPLACE DESCR('Input queue for CICS01') +
      initq(CICS01.INITQ)  PROCESS('CICS01.PROCESS') TRIGGER TRIGTYPE(every)
define process(CICS01.PROCESS) REPLACE DESCR('user transaction') +
      APPLTYPE(CICS) APPLICID('QCTL') USERDATA('data from process')
define qlocal(CICS01.OUT)   REPLACE DESCR('Output queue for CICS01')

 

XCICS configuration

set use_mqseries=yes;
 
# server XA string:
set mqseries_xa_string="qmname=venus.queue.manager";
 
# client XA string:
# set mqseries_xa_string="channel=CHANNEL.FC,trptype=tcp,conname=hpux02,qmname=venus.queue.manager"
 
set mqseries_queue_manager=venus.queue.manager;
add mqtrgmon queue=CICS01.INITQ;
 
define program name=MYPROGRAM;
define transaction name=QCTL, program=MYPROGRAM, twa=512, protection=1;