Reply-to queue alias example

This example illustrates the use of a reply-to alias to select a different route (transmission queue) for returned messages. The use of this facility requires the reply-to queue name to be changed in cooperation with the applications.

As shown in Figure 1, the return route must be available for the reply messages, including the transmission queue, channel, and queue manager alias.
Figure 1. Reply-to queue alias example

This example is for requester applications at 'QM1' that send messages to server applications at 'QM2'. The messages on the server are to be returned through an alternative channel using transmission queue 'QM1_relief' (the default return channel would be served with a transmission queue 'QM1').

The reply-to queue alias is a particular use of the remote queue definition named 'Answer_alias'. Applications at QM1 include this name, 'Answer_alias', in the reply-to field of all messages that they put on queue 'Inquiry'.

Reply-to queue definition 'Answer_alias' is defined as 'Answer at QM1_relief'. Applications at QM1 expect their replies to appear in the local queue named 'Answer'.

Server applications at QM2 use the reply-to field of received messages to obtain the queue and queue manager names for the reply messages to the requester at QM1.


Definitions used in this example at QM1

The IBM MQ system administrator at QM1 must ensure that the reply-to queue 'Answer' is created along with the other objects. The name of the queue manager alias, marked with a '*', must agree with the queue manager name in the reply-to queue alias definition, also marked with an '*'.

Object Definition  
Local transmission queue QM2  
Remote queue definition Object name Inquiry
  Remote queue manager name QM2
  Remote queue name Inquiry
  Transmission queue name QM2 (DEFAULT)
Queue manager alias Object name QM1_relief *
  Queue manager name QM1
  Queue name (blank)
Reply-to queue alias Object name Answer_alias
  Remote queue manager name QM1_relief *
  Remote queue name Answer


Put definition at QM1

Applications fill the reply-to fields with the reply-to queue alias name, and leave the queue manager name field blank.

Field Content  
Queue name Inquiry  
Queue manager name (blank)  
Reply-to queue name Answer_alias  
Reply-to queue manager (blank)  


Definitions used in this example at QM2

The IBM MQ system administrator at QM2 must ensure that the local queue exists for the incoming messages, and that the correctly named transmission queue is available for the reply messages.

Object Definition  
Local queue Inquiry  
Transmission queue QM1_relief  


Put definition at QM2

Applications at QM2 retrieve the reply-to queue name and queue manager name from the original message and use them when putting the reply message on the reply-to queue.

Field Content  
Queue name Answer  
Queue manager name QM1_relief  
Parent topic: Reply-to queue