The AMQ3SRV4 sample trigger server

AMQ3SRV4 is a trigger server. It takes one parameter: the name of the initiation queue it is to serve. AMQSAMP4 defines a sample initiation queue, SYSTEM.SAMPLE.TRIGGER, that we can use when you try the sample programs.

For each trigger message, AMQ3SRV4 runs a start command in its own job to start the specified application.

Using the example trigger queue the command to issue is:
CALL PGM(QMQM/AMQ3SRV4) PARM('Queue Name')

Where Queue Name must be 48 characters in length, which you achieve by padding the queue name with the required number of blanks. Therefore, if we are using SYSTEM.SAMPLE.TRIGGER as your target queue, we will need 28 blank characters.


Design of the trigger server

The design of the trigger server is like that of the trigger monitor, except the trigger server:

  • Allows CICS as well as IBM i applications
  • Does not use the environment data from the trigger message
  • Calls IBM i applications in its own job (or uses STRCICSUSR to start CICS applications) rather than submitting an IBM i job
  • Opens the initiation queue for shared input, so many trigger servers can run at the same time

Note: Programs started by AMQ3SRV4 must not use the MQDISC call because this will stop the trigger server. If programs started by AMQ3SRV4 use the MQCONN call, they will get the RC2002 reason code. Parent topic: The Triggering sample programs on IBM i