Before your application can take advantage of triggering, follow the steps below:
DEFINE QLOCAL (initiation.queue) REPLACE + LIKE (SYSTEM.DEFAULT.LOCAL.QUEUE) + DESCR ('initiation queue description')
or
DEFINE QLOCAL (application.queue) REPLACE + LIKE (SYSTEM.DEFAULT.LOCAL.QUEUE) + DESCR ('appl queue description') + INITQ ('initiation.queue') + PROCESS ('process.name') + TRIGGER + TRIGTYPE (FIRST)
Here is an extract from a CL program for WebSphere MQ for iSeries
that creates an initiation queue:
/* Queue used by AMQSINQA */
CRTMQMQ QNAME('SYSTEM.SAMPLE.INQ') +
QTYPE(*LCL) REPLACE(*YES) +
MQMNAME +
TEXT('queue for AMQSINQA') +
SHARE(*YES) /* Shareable */+
DFTMSGPST(*YES)/* Persistent messages OK */+
+
TRGENBL(*YES) /* Trigger control on */+
TRGTYPE(*FIRST)/* Trigger on first message*/+
PRCNAME('SYSTEM.SAMPLE.INQPROCESS') +
INITQNAME('SYSTEM.SAMPLE.TRIGGER')
DEFINE PROCESS (process.name) + REPLACE + DESCR ('process description') + APPLTYPE ('CICS') + APPLICID ('PAYR') + USERDATA ('Payroll data')
Here is an extract from a CL program for WebSphere MQ for iSeries that creates a process definition object:
/* Process definition */ CRTMQMPRC PRCNAME('SYSTEM.SAMPLE.INQPROCESS') + REPLACE(*YES) + MQMNAME + TEXT('trigger process for AMQSINQA') + ENVDATA('JOBPTY(3)') /* Submit parameter */+ APPID('AMQSINQA') /* Program name */
When the queue manager creates a trigger message, it copies information
from the attributes of the process definition object into the trigger
message.
Platform | To create a process definition object |
---|---|
UNIX systems, Compaq OpenVMS Alpha, Windows systems | Use DEFINE PROCESS or use SYSTEM.DEFAULT.PROCESS and modify using ALTER PROCESS |
z/OS | Use DEFINE PROCESS (see sample code in step 3), or use the operations and control panels. |
OS/400 | Use a CL program containing code as in step 3. |
The TrigData attribute can contain the name of the channel to be triggered or it can be left blank. Except on WebSphere MQ for z/OS, if it is left blank, the channel initiator searches the channel definition files until it finds a channel that is associated with the named transmission queue. When the queue manager creates a trigger message, it copies information from the TrigData attribute of the transmission queue definition into the trigger message.
Platform | Use commands |
---|---|
UNIX systems, Compaq OpenVMS Alpha, OS/2, Windows systems | ALTER QLOCAL |
z/OS | ALTER QLOCAL |
OS/400 | CHGMQMQ |
If you wish to be aware of any undelivered trigger messages, make sure your queue manager has a dead-letter (undelivered-message) queue defined. Specify the name of the queue in the DeadLetterQName queue manager field.
You can then set the trigger conditions you require, using the attributes of the queue object that defines your application queue. For more information on this, see Controlling trigger events.