MQTM - Trigger message

The MQTM structure describes the data in the trigger message that is sent by the queue manager to a trigger-monitor application when a trigger event occurs for a queue.


Overview

Purpose: This structure is part of the IBM MQ Trigger Monitor Interface (TMI), which is one of the IBM MQ framework interfaces.

Format name: FMTM.

Character set and encoding: Character data in MQTM is in the character set of the queue manager that generates the MQTM. Numeric data in MQTM is in the machine encoding of the queue manager that generates the MQTM.

The character set and encoding of the MQTM are given by the MDCSI and MDENC fields in:

  • The MQMD (if the MQTM structure is at the start of the message data), or
  • The header structure that precedes the MQTM structure (all other cases).

Usage: A trigger-monitor application may need to pass some or all of the information in the trigger message to the application which is started by the trigger-monitor application. Information which may be needed by the started application includes TMQN, TMTD, and TMUD. The trigger-monitor application can pass the MQTM structure directly to the started application, or pass an MQTMC2 structure instead, depending on what is permitted by the environment and convenient for the started application. For information about MQTMC2, see MQTMC2 (Trigger message 2 - character format) on IBM i.

  • On IBM i, the trigger-monitor application provided with IBM MQ passes an MQTMC2 structure to the started application.

For information about triggers, see Prerequisites for triggering.


MQMD for a trigger message

Field in MQMD Value used
MDSID MDSIDV
MDVER MDVER1
MDREP RONONE
MDMT MTDGRM
MDEXP EIULIM
MDFB FBNONE
MDENC ENNAT
MDCSI Queue manager's CodedCharSetId attribute
MDFMT FMTM
MDPRI Initiation queue's DefPriority attribute
MDPER PENPER
MDMID A unique value
MDCID CINONE
MDBOC 0
MDRQ Blanks
MDRM Name of queue manager
MDUID Blanks
MDACC ACNONE
MDAID Blanks
MDPAT ATQM, or as appropriate for the message channel agent
MDPAN First 28 bytes of the queue manager name
MDPD Date when trigger message is sent
MDPT Time when trigger message is sent
MDAOD Blanks
An application that generates a trigger message is recommended to set similar values, except for the following:

  • The MDPRI field can be set to PRQDEF (the queue manager will change this to the default priority for the initiation queue when the message is put).
  • The MDRM field can be set to blanks (the queue manager will change this to the name of the local queue manager when the message it put).
  • The context fields should be set as appropriate for the application.


Fields

The MQTM structure contains the following fields; the fields are described in alphabetical order:

    TMAI (256-byte character string)

    Application identifier.

    This is a character string that identifies the application to be started, and is used by the trigger-monitor application that receives the trigger message. The queue manager initializes this field with the value of the ApplId attribute of the process object identified by the TMPN field; see Attributes for process definitions on IBM i for details of this attribute. The content of this data is of no significance to the queue manager.

    The meaning of TMAI is determined by the trigger-monitor application. The trigger monitor provided by IBM MQ requires TMAI to be the name of an executable program.

    The length of this field is given by LNPROA. The initial value of this field is 256 blank characters.

    TMAT (10-digit signed integer)

    Application type.

    This identifies the nature of the program to be started, and is used by the trigger-monitor application that receives the trigger message. The queue manager initializes this field with the value of the ApplType attribute of the process object identified by the TMPN field; see Attributes for process definitions on IBM i for details of this attribute. The content of this data is of no significance to the queue manager.

    TMAT can have one of the following standard values. User-defined types can also be used, but should be restricted to values in the range ATUFST through ATULST:

      ATCICS
      CICS transaction.

      ATVSE
      CICS/VSE transaction.

      AT400
      IBM i application.

      ATUFST
      Lowest value for user-defined application type.

      ATULST
      Highest value for user-defined application type.

    The initial value of this field is 0.

    TMED (128-byte character string)

    Environment data.

    This is a character string that contains environment-related information pertaining to the application to be started, and is used by the trigger-monitor application that receives the trigger message. The queue manager initializes this field with the value of the EnvData attribute of the process object identified by the TMPN field; see Attributes for process definitions on IBM i for details of this attribute. The content of this data is of no significance to the queue manager.

    The length of this field is given by LNPROE. The initial value of this field is 128 blank characters.

    TMPN (48-byte character string)

    Name of process object.

    This is the name of the queue manager process object specified for the triggered queue, and can be used by the trigger-monitor application that receives the trigger message. The queue manager initializes this field with the value of the ProcessName attribute of the queue identified by the TMQN field; see Attributes for queues for details of this attribute.

    Names that are shorter than the defined length of the field are always padded to the right with blanks; they are not ended prematurely by a null character.

    The length of this field is given by LNPRON. The initial value of this field is 48 blank characters.

    TMQN (48-byte character string)

    Name of triggered queue.

    This is the name of the queue for which a trigger event occurred, and is used by the application started by the trigger-monitor application. The queue manager initializes this field with the value of the QName attribute of the triggered queue; see Attributes for queues for details of this attribute.

    Names that are shorter than the defined length of the field are padded to the right with blanks; they are not ended prematurely by a null character.

    The length of this field is given by LNQN. The initial value of this field is 48 blank characters.

    TMSID (4-byte character string)

    Structure identifier.

    The value must be:

      TMSIDV
      Identifier for trigger message structure.

    The initial value of this field is TMSIDV.

    TMTD (64-byte character string)

    Trigger data.

    This is free-format data for use by the trigger-monitor application that receives the trigger message. The queue manager initializes this field with the value of the TriggerData attribute of the queue identified by the TMQN field; see Attributes for queues for details of this attribute. The content of this data is of no significance to the queue manager.

    The length of this field is given by LNTRGD. The initial value of this field is 64 blank characters.

    TMUD (128-byte character string)

    User data.

    This is a character string that contains user information relevant to the application to be started, and is used by the trigger-monitor application that receives the trigger message. The queue manager initializes this field with the value of the UserData attribute of the process object identified by the TMPN field; see Attributes for process definitions on IBM i for details of this attribute. The content of this data is of no significance to the queue manager.

    The length of this field is given by LNPROU. The initial value of this field is 128 blank characters.

    TMVER (10-digit signed integer)

    Structure version number.

    The value must be:

      TMVER1
      Version number for trigger message structure.

    The following constant specifies the version number of the current version:

      TMVERC
      Current version of trigger message structure.

    The initial value of this field is TMVER1.


Initial values

Field name Name of constant Value of constant
TMSID TMSIDV 'TM¬¬'
TMVER TMVER1 1
TMQN None Blanks
TMPN None Blanks
TMTD None Blanks
TMAT None 0
TMAI None Blanks
TMED None Blanks
TMUD None Blanks
Notes:
  1. The symbol ¬ represents a single blank character.


RPG declaration

     D*..1....:....2....:....3....:....4....:....5....:....6....:....7..
     D*
     D* MQTM Structure
     D*
     D* Structure identifier
     D  TMSID                  1      4    INZ('TM  ')
     D* Structure version number
     D  TMVER                  5      8I 0 INZ(1)
     D* Name of triggered queue
     D  TMQN                   9     56    INZ
     D* Name of process object
     D  TMPN                  57    104    INZ
     D* Trigger data
     D  TMTD                 105    168    INZ
     D* Application type
     D  TMAT                 169    172I 0 INZ(0)
     D* Application identifier
     D  TMAI                 173    428    INZ
     D* Environment data
     D  TMED                 429    556    INZ
     D* User data
     D  TMUD                 557    684    INZ
Parent topic: Data type descriptions on IBM i