Home
What is a reply-to queue alias definition?
A reply-to queue alias definition specifies alternative names for the reply information in the message descriptor. The advantage of this is that we can alter the name of a queue or queue manager without having to alter your applications. Queue name resolution takes place at the sending end, before the message is put to a queue.
This is an unusual use of queue-name resolution. It is the only situation in which name resolution takes place at a time when a queue is not being opened.
Normally an application specifies a reply-to queue and leaves the reply-to queue manager name blank. The queue manager fills in its own name at put time. This works well except when you want an alternate channel to be used for replies, for example, a channel that uses transmission queue 'QM1_relief' instead of the default return channel which uses transmission queue 'QM1'. In this situation, the queue manager names specified in transmission-queue headers do not match “real” queue manager names but are re-specified using queue manager alias definitions. In order to return replies along alternate routes, it is necessary to map reply-to queue data as well, using reply-to queue alias definitions.
Figure 1. Reply-to queue alias used for changing reply location
In the example in Figure 1:
- The application puts a message using the MQPUT call and specifying the following in the message descriptor:
ReplyToQ=‘Reply_to’ ReplyToQMgr=‘’Note that ReplyToQMgr must be blank in order for the reply-to queue alias to be used.
- You create a reply-to queue alias definition called ‘Reply_to’, which contains the name ‘Answer’, and the queue manager name ‘QM1_relief’.
DEFINE QREMOTE ('Reply_to') RNAME ('Answer') RQMNAME ('QM1_relief')- The messages are sent with a message descriptor showing ReplyToQ=‘Answer’ and ReplyToQMgr=‘QM1_relief’.
- The application specification must include the information that replies are to be found in queue ‘Answer’ rather than ‘Reply_to’.
To prepare for the replies you have to create the parallel return channel. This involves defining:
- At QM2, the transmission queue named ‘QM1_relief’
DEFINE QLOCAL ('QM1_relief') USAGE(XMITQ)- At QM1, the queue manager alias QM1_relief’
DEFINE QREMOTE ('QM1_relief') RNAME() RQMNAME(QM1)This queue manager alias terminates the chain of parallel return channels and captures the messages for QM1.
If you think you might want to do this at sometime in the future, arrange for your applications to use the alias name from the start. For now this is a normal queue alias to the reply-to queue, but later it can be changed to a queue manager alias.
Parent topic:
Reply-to queue alias definitions
ic10710_
Home