Triggering for beginners
RichardHamilton 060001RC0R Visits (9653)
Getting Started with Triggering
Triggering is the MQ feature that auto starts programs to MQGET messages from WebSphere MQ queues. If you want to have a fully automated MQ environment, then you need to use triggering. Some special configuration is required, that's the hard part, but after the configuration is working as expected, then MQ trigger event messages will auto start your programs.
There are three MQ objects that must be defined: Application queue, Initiation Queue, and Process. The application queue definition must specify the name of the Initiation queue, the name of the Process, it must be put and get enabled, and trigger control must be set to "trigger". Trigger control is a parm that has no value, so it will be displayed as "trigger" or "notrigger". Example: ALTER QLOCAL (APPLICATION.QUEUE) TRIGGER
The initiation queue does not require any special attributes, but it must be put and get enabled.
The process must specify the application type, and the full path and name of the program that you want to trigger start. You must also have a trigger monitor running and it must be monitoring the Initiation queue. Make sure that the trigger monitor is monitoring the initiation queue, not the application queue, this is a very common error.
Here is the sequence of events in a working scenario (see Figure 1 below):
See Conditions for a trigger event in the WebSphere MQ information center for more information.
So, you have created the MQ object definitions and tested your configuration. If User program "B" starts, and gets the messages from the application queue, then congratulations, triggering is working. However, if it doesn't work, then you need to start debugging.
Display the application queue and ensure that it is put and get enabled and has triggering attribute set to "trigger". Also, verify that the initq and process parms contain the exact name of the initiation queue and the process (case matters). Use the runmqsc alter qlocal command to make any required changes.
Display the initiation queue and ensure that the initiation queue input use count is one (ipprocs (1)). This is a good indication that the trigger monitor is running and monitoring the correct queue. If ipprocs (0), then the trigger monitor is not running, or it is not monitoring the initiation queue. Start or restart your trigger monitor using the runmqtrm command (see the example below).
Display the process definition and ensure that the process applicid parm has the fully qualified path to the program. Also, verify that the user has the authority to access the entire path to the program. Test by entering the contents of applicid at a command prompt. It should start the program if the path and authorizations are OK.
Examples of the commands mentioned above:
DISPLAY QLOCAL (APPLICATION.QUEUE)
RUNMQTRM -q INITIATION.QUEUE -m TRIGGER.QMGR
TRIGGER.QMGR is the name of the queue manager.
Note: Triggering channels is a bit easier to configure, but harder to debug. I will discuss this is a future post to this blog.