Running the Request sample using triggering on AIX, Linux, and Windows
On AIX®, Linux®, and Windows, start the trigger monitor program RUNMQTRM in one session, and then start the amqsreq program in another session.
- Start the trigger monitor program RUNMQTRM in one session (the initiation queue SYSTEM.SAMPLE.TRIGGER is available for you to use).
- Start the amqsreq program in another session.
- Make sure that you have defined a target server queue. The sample queues available to you to use as the target server queue for the request sample to put messages are:
- SYSTEM.SAMPLE.INQ - for the Inquire sample program
- SYSTEM.SAMPLE.SET - for the Set sample program
- SYSTEM.SAMPLE.ECHO - for the Echo sample program
- Make sure that you have defined a queue for the Inquire, Set or Echo sample program to use.
This means that the trigger monitor is ready when the request sample sends a message.

In Figure 1 the Request sample puts messages onto the target server queue, SYSTEM.SAMPLE.INQ, and the Inquire sample queries the queue, MYQUEUE. Alternatively, you can use one of the sample queues defined when you ran amqscos0.tst, or any other queue that you have defined, for the Inquire sample.
- Check that the queues that you want to use are defined. Run amqscos0.tst, to define the sample queues, and define a queue MYQUEUE.
- Run the trigger monitor command RUNMQTRM:
RUNMQTRM -m qmanagername -q SYSTEM.SAMPLE.TRIGGER - Run the request sample
amqsreq SYSTEM.SAMPLE.INQNote: The process object defines what is to be triggered. If the client and server are not running on the same platform, any processes started by the trigger monitor must defineApplType, otherwise the server takes its default definitions (that is, the type of application that is normally associated with the server machine) and causes a failure.For a list of application types, see ApplType.
- Enter the name of the queue that you want the Inquire sample to use:
MYQUEUE - Enter a blank line (to end the Request program).
- The request sample will then display a message, containing the data the Inquire program obtained from MYQUEUE.
You can use more than one queue; in this case, enter the names of the other queues at step 4.
For more information on triggering see Starting IBM MQ applications using triggers.