UNIX systems, and Windows systems

 

To run the samples using triggering:

  1. Start the trigger monitor program RUNMQTRM in one session (the initiation queue SYSTEM.SAMPLE.TRIGGER is available for you to use).

  2. Start the amqsreq program in another session.

  3. 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

    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.

  4. 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.

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 you have defined, for the Inquire sample.

The numbers in Figure 1 show the sequence of events.

To run the Request and Inquire samples, using triggering:

  1. Check that the queues that you want to use are defined. Run amqscos0.tst, to define the sample queues, and define a queue MYQUEUE.

  2. Run the trigger monitor command RUNMQTRM:
    RUNMQTRM -m qmanagername -q SYSTEM.SAMPLE.TRIGGER

  3. Run the request sample
    amqsreq SYSTEM.SAMPLE.INQ

    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.

    For a list of application types, see the Application Programming Reference.

  4. Enter the name of the queue that you want the Inquire sample to use:
    MYQUEUE

  5. Enter a blank line (to end the Request program).

  6. The request sample will then display a message, containing the data the Inquire program obtained from MYQUEUE.

We 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 WebSphere MQ applications using triggers.

 

Parent topic:

Running the Request sample using triggering


fg17520_