Defining and installing MQMONITOR resources

You can choose to install MQMONITOR resources to process incoming messages on MQ queues including initiation queues. You can have more than one MQMONITOR resource processing incoming messages on an MQ queue. Using MQMONITOR resources is the recommended method of controlling instances of the CICS®-MQ trigger monitor, CKTI.

Before you begin

You can install MQMONITOR resources only if you have previously installed an MQCONN resource.

About this task

You can define and install MQMONITOR resources to control the CICS-MQ trigger monitor, CKTI.

You can also define and install MQMONITOR resources for your user-written trigger monitors or MQ message consumers. When a user-written MQ monitor program, rather than the default CKTI, is to be used with an MQMONITOR resource, it is the responsibility of the user-written program to get messages directly from application queues and perform the required logic. When you code your program, ensure to follow the guidelines described in Developing and using user-written MQ trigger monitors and MQ message consumers.

Note: The CICS-supplied MQ trigger monitor program DFHMQTSK is reserved for use with the CICS-MQ trigger monitor and task initiator transaction CKTI. Any attempt to invoke DFHMQTSK as a user transaction will cause the user transaction to abend with abend code AMQO.

You can install a new MQMONITOR at any time, even when the CICS-MQ adapter is connected to MQ.

You can reinstall (by replacing) an existing MQMONITOR only when the MQMONITOR is disabled and no transaction is using it. Use the SET MQMONITOR DISABLED STOPPED command to stop the associated task and disable the resource.

You can discard an MQMONITOR only if it is disabled and there is no associated task. Use the SET MQMONITOR DISABLED STOPPED command to stop the associated task and disable the resource.

When you install an MQCONN resource that specifies a value in the INITQNAME attribute, CICS also dynamically creates and installs an MQMONITOR resource with the reserved name of DFHMQINI representing the default initiation queue.

For details about DFHMQINI, see MQMONITOR resources.

Procedure

  1. Define MQMONITOR resources by using one of the methods listed in Ways of defining CICS resources.
    For example, you can use the CREATE MQMONITOR command to define an MQMONITOR resource.

    Table 1 list shows important attributes for creating an MQMONITOR resource.

    Table 1. Important MQMONITOR attributes
    Attribute Required / Optional Default Description
    AUTOSTART Optional YES This attribute controls auto-restart of the MQ monitor.
    AUTOSTART(YES)
    Enables the transaction as specified in the TRANSACTION attribute to restart automatically when the connection to the MQ queue manager is established.
    AUTOSTART(NO)
    The MQ monitor is not started automatically. After the connection to the MQ queue manager is established, you have to manually start the MQ monitor.
    MONUSERID Required - Specifies the user ID to be associated with the transaction monitoring the MQ queue. This attribute is only effective when security checking is active (that is, the SEC system initialization parameter is set to YES). If security checking is disabled (that is, SEC is set to NO), the user ID to be associated with the MQ monitor transaction is the user ID of the transaction that set the state of the MQMONITOR resource to started.
    QNAME Optional

    If QNAME is omitted, the value is set to &APPLID..INITIATION.QUEUE by default when the resource is installed.

    Specifies the name of the MQ queue to be monitored.
    STATUS Optional ENABLED This attribute makes the resource available for use in the region.
    TRANSACTION Optional CKTI Specifies the 4-character ID of the CICS transaction monitoring the MQ queue.

    If you are defining an MQMONITOR for monitoring an MQ initiation queue, specify CKTI or leave blank.

    In order for CICS to attempt to automatically start the transaction that is associated with the MQMONITOR, ensure that the MQMONITOR resource has attributes AUTOSTART(YES) and STATUS(ENABLED).

  2. Install the MQMONITOR resource.