Queue manager QM2 example for z/OS
The following object definitions allow applications connected to queue manager QM2 to retrieve request messages from a local queue called PAYROLL and to put replies to these request messages to a queue called PAYROLL.REPLY on queue manager QM1.
You do not need to provide a remote queue definition to enable the replies to be returned to QM1. The message descriptor of the message retrieved from local queue PAYROLL contains both the reply-to queue and the reply-to queue manager names. Therefore, as long as QM2 can resolve the reply-to queue manager name to that of a transmission queue on queue manager QM2, the reply message can be sent. In this example, the reply-to queue manager name is QM1 and so queue manager QM2 requires a transmission queue of the same name.
All the object definitions have been provided with the DESCR and REPLACE attributes and are the minimum required to make the example work. The attributes that are not supplied take the default values for queue manager QM2.
Run the following commands on queue manager QM2.
Local queue definition
DEFINE QLOCAL(PAYROLL) REPLACE PUT(ENABLED) GET(ENABLED) + DESCR('Local queue for QM1 payroll details')This queue is defined as PUT(ENABLED) and GET(ENABLED) for the same reason as the reply-to queue definition on queue manager QM1.
Transmission queue definition
DEFINE QLOCAL(QM1) DESCR('Transmission queue to QM1') REPLACE + USAGE(XMITQ) PUT(ENABLED) GET(ENABLED) TRIGGER TRIGTYPE(FIRST) + TRIGDATA(QM2.TO.QM1) INITQ(SYSTEM.CHANNEL.INITQ)When the first message is put on this transmission queue, a trigger message is sent to the initiation queue, SYSTEM.CHANNEL.INITQ. The channel initiator gets the message from the initiation queue and starts the channel identified in the trigger data. The channel initiator can only get trigger messages from SYSTEM.CHANNEL.INITQ so do not use any other queue as the initiation queue.
Sender channel definition
For a TCP/IP connection:DEFINE CHANNEL(QM2.TO.QM1) CHLTYPE(SDR) TRPTYPE(TCP) + REPLACE DESCR('Sender channel to QM1') XMITQ(QM1) + CONNAME('192.0.2.0(1411)')For an LU 6.2 connection:DEFINE CHANNEL(QM2.TO.QM1) CHLTYPE(SDR) TRPTYPE(LU62) + REPLACE DESCR('Sender channel to QM1') XMITQ(QM1) + CONNAME('LUNAME1')
Receiver channel definition
For a TCP/IP connection:DEFINE CHANNEL(QM1.TO.QM2) CHLTYPE(RCVR) TRPTYPE(TCP) + REPLACE DESCR('Receiver channel from QM1')For an LU 6.2 connection:DEFINE CHANNEL(QM1.TO.QM2) CHLTYPE(RCVR) TRPTYPE(LU62) + REPLACE DESCR('Receiver channel from QM1')Parent topic: What the example for z/OS shows