Sunday 21 July 2013

Queue Manager Alias - Case Study

I was doing experiments to understand Queue Manager Alias concepts..
Hope my Case study would be useful to all who is involved in this Technology

Hints
·         Remote Queue Definition is only for the Queue manager resolution.It is not for Application which is connected to the first Queue manager.The Application will always try to give only the local queue name and Queue manager name to which it is intended to place  its message for the destiny Queue manager.
Transmission queues
·         In Remote Queue Definition, I am defining Transmission queue name.The same name is used in MCA (Channel definition) .This name could be anything now.It will work.
·         In RQD, I am not specifying the XMIT queue name.Then,the Queue manager will look for the XMIT queue defined with the same name of the Remote Queue Manager name in RQD.
·                If it is defined ,it will use that XMIT queue and it will transport.So,now also it will work.
·               Else if,it is not defined,it will place the message in default Transmission queue.
QueueManager Alias
Generally, queue-manager alias is used to resolve a queue-manager name. One of the uses of a queue-manager alias is to move a message down the network to one or more intermediary, non-adjacent, queue-managers. This network arrangement is often called a daisy-chain.

In a daisy-chain network arrangement, one queue-manager is networked to the next queue-manager, which is networked to the next queue-manager (QM1 -> QM2 -> QM3 -> QM4 -> QM5). If a message is created on QM1, and the destination queue-manager is on QM5, then the message must traverse QM2, QM3, and QM4. QM2 and QM3 will need a queue-manager aliases since they are non-adjacent (don't have a transmission queue) to the destination queue-manager. 

Simple daisy-chain example
QM1 -> QM2 -> QM3 -> QM4 -> QM5
When a message is created on QM1, it needs to be moved to QM2, on its way toward QM5. There is no hub in this configuration. QM2 needs a definition to move the message from QM2 to the next hop QM3. 

So, when the message arrives on QM2, a queue-manager alias must exist to resolve the queue-manager name in the XQH (transmission queue header): DEF QR(QM5) RQMname(QM5) XMITQ(QM3). 

This definition tells the MCA (message channel agent) on QM2 to move the message to transmission queue named QM3, so that the message will be sent to QM3. 

When the message arrives on QM3, a queue-manager alias will be needed to move the message to a transmission queue named QM4: DEF QR(QM5) RQMname(QM5) XMITQ(QM4).
Transmission Headers
The queue name used by the application, the logical queue name, is resolved by the queue manager to the destination queue name, that is, the physical queue name. This destination queue name travels with the message in a separate data area, the transmission header, until the destination queue has been reached after which the transmission header is stripped off.

Initial setup –Distributed Messaging

1)QM1 ,QM2,QM3,QM4  are in distributed queueing as shown below,
QM1 -
              àQM2
              àQM3 à QM4

Case Study 1

       A message has to be sent from QM1 to QM4

Create a message broker flow which acts as an application connected to a Queue manager.This Application wants to put message to some other Queue manager.
QM1 is broker Queue manager
QM4 is the destiny Queue manager

But anyhow,it cannot directly MQOPEN to the destiny Queuemanager name and Queue name.
It can only place its message to a Remote Queue definition in the queuemanager .So,since the Application wants to put message to different queue manager, as per the Application’s need,RQD is created with Remote Queue manager name as ‘destinyQM_name’ .

 In defining the XMIT Queue name àI am giving the XMIT queue as QM3.

Configuration
At QM1:
   Remote Queue Definition : QM4 as Remote Queue manager
                                                    QM3 as XMIT Queue
                                                       OUT as Remote Queue
  Now ,at this point,the message transmission header contains QM4 as Remote QM name and OUT as remote Queue name once it falls to QM3 from QM1.

At QM3:
Now it’s the task of resolving the transmission header of the message by QM3 Queue manager.It needs to resolve QM4 from the transmission message header.Though it can easily resolve the Queue manager as it is its adjacent Queue manager,certain naming conventions has to be followed.
There are two different  ways to configure here:
1)      Define the XMIT queue name QM4 same name as that of  queue manager name QM4.

By this way,the QM3 can easily resolve its adjacent queue manager through the XMIT queue name.

2)      Define a Queue manager alias for QM4 in QM3 with the same name.This has to be done if the transmission queue is not of the same name as that of QM4.
At QM4:
  Local queue OUT is defined.

No comments:

Post a Comment