Queue manager QM1 example for z/OS
The following object definitions allow applications connected to queue manager QM1 to send request messages to a queue called PAYROLL on QM2. It also allows applications to receive replies on a queue called PAYROLL.REPLY on QM1.
All the object definitions have been provided with the DESCR and REPLACE attributes. The other attributes supplied are the minimum required to make the example work. The attributes that are not supplied take the default values for queue manager QM1.
Run the following commands on queue manager QM1.
Remote queue definition
DEFINE QREMOTE(PAYROLL.QUERY) DESCR('Remote queue for QM2') REPLACE + PUT(ENABLED) XMITQ(QM2) RNAME(PAYROLL) RQMNAME(QM2)Note: The remote queue definition is not a physical queue, but a means of directing messages to the transmission queue, QM2, so that they can be sent to queue manager QM2.
Transmission queue definition
DEFINE QLOCAL(QM2) DESCR('Transmission queue to QM2') REPLACE + USAGE(XMITQ) PUT(ENABLED) GET(ENABLED) TRIGGER TRIGTYPE(FIRST) + TRIGDATA(QM1.TO.QM2) 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 the SYSTEM.CHANNEL.INITQ queue, so do not use any other queue as the initiation queue.
Sender channel definition
For a TCP/IP connection:DEFINE CHANNEL(QM1.TO.QM2) CHLTYPE(SDR) TRPTYPE(TCP) + REPLACE DESCR('Sender channel to QM2') XMITQ(QM2) + CONNAME('192.0.2.1(1412)')For an LU 6.2 connection:DEFINE CHANNEL(QM1.TO.QM2) CHLTYPE(SDR) TRPTYPE(LU62) + REPLACE DESCR('Sender channel to QM2') XMITQ(QM2) + CONNAME('LUNAME2')
Receiver channel definition
For a TCP/IP connection:DEFINE CHANNEL(QM2.TO.QM1) CHLTYPE(RCVR) TRPTYPE(TCP) + REPLACE DESCR('Receiver channel from QM2')For an LU 6.2 connection:DEFINE CHANNEL(QM2.TO.QM1) CHLTYPE(RCVR) TRPTYPE(LU62) + REPLACE DESCR('Receiver channel from QM2')
Reply-to queue definition
DEFINE QLOCAL(PAYROLL.REPLY) REPLACE PUT(ENABLED) GET(ENABLED) + DESCR('Reply queue for replies to query messages sent to QM2')The reply-to queue is defined as PUT(ENABLED) which ensures that reply messages can be put to the queue. If the replies cannot be put to the reply-to queue, they are sent to the dead-letter queue on QM1 or, if this queue is not available, remain on transmission queue QM1 on queue manager QM2. The queue has been defined as GET(ENABLED) to allow the reply messages to be retrieved.
Parent topic: What the example for z/OS shows