The Echo sample programs

 

The Echo sample programs echo a message from a message queue to the reply queue. See Features demonstrated in the sample programs for the names of these programs.

The programs are intended to run as triggered programs.

On i5/OS, UNIX systems, and Windows systems, their only input is an MQTMC2 (trigger message) structure that contains the name of a target queue and the queue manager. The COBOL version uses the default queue manager.

On i5/OS, for the triggering process to work, ensure that the Echo sample program that you want to use is triggered by messages arriving on queue SYSTEM.SAMPLE.ECHO. To do this, specify the name of the Echo sample program that you want to use in the ApplId field of the process definition SYSTEM.SAMPLE.ECHOPROCESS. (For this, we can use the CHGMQMPRC command, described in WebSphere MQ for iSeries System Administration Guide.) The sample queue has a trigger type of FIRST, so, if there are already messages on the queue before you run the Request sample, the Echo sample is not triggered by the messages that you send.

When you have set the definition correctly, first start AMQSERV4 in one job, then start AMQSREQ4 in another. You could use AMQSTRG4 instead of AMQSERV4, but potential job submission delays could make it less easy to follow what is happening.

Use the Request sample programs to send messages to queue SYSTEM.SAMPLE.ECHO. The Echo sample programs send a reply message containing the data in the request message to the reply-to queue specified in the request message.

 

Parent topic:

Sample programs (all platforms except z/OS)


fg17590_