Running the Request sample using triggering on UNIX, Linux, and Windows
On UNIX, Linux, and Windows, start the trigger monitor program RUNMQTRM in one
session, and then start the amqsreq program in another session.
To run the samples using triggering:
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 we 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
These queues have a trigger type of FIRST, so if there are already messages on the queues
before you run the Request sample, server applications are not triggered by the messages you send.
Make sure that we 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.
Note: The sample process definitions created using RUNMQSC and the amqscos0.tst file trigger the C
samples. Change the process definitions in amqscos0.tst and use RUNMQSC with this updated file to
use COBOL versions.
Figure 1 demonstrates how to use the Request and Inquire samples
together.Figure 1. Request and Inquire samples using triggering
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, we can
use one of the sample queues defined when you ran amqscos0.tst, or any other queue that we have
defined, for the Inquire sample.
Note: The numbers in Figure 1 show the sequence of events.
To run the Request and Inquire samples, using triggering:
Check that the queues that we 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.INQ
Note: 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 define
ApplType, 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.