The Set sample program

The Set sample program, AMQ3SET4, inhibits put operations on a queue by using the MQSET call to change the queue's InhibitPut attribute.

The program is intended to run as a triggered program, so its only input is an MQTMC (trigger message) structure that contains the name of a target queue whose attributes are to be inquired.

For the triggering process to work, ensure that the Set sample program is triggered by messages arriving on queue SYSTEM.SAMPLE.SET. To do this, specify the name of the Set sample program in the ApplId field of the process definition SYSTEM.SAMPLE.SETPROCESS. (For this, we can use the CHGMQMPRC command, described in the WebSphere MQ for iSeries V6 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 Set sample is not triggered by the messages you send.

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

Use the Request sample program to send request messages, each containing just a queue name, to queue SYSTEM.SAMPLE.SET. For each request message, the Set sample program sends a reply message containing a confirmation that put operations have been inhibited on the specified queue. The replies are sent to the reply-to queue specified in the request message.