Local Queue Resolution

Local message putting is the bedrock upon which WebSphere MQ Everyplace stands. Messages, if they are to be useful, must always end up on a local queue. Message route resolution is the mechanism by which a message travels through a WebSphere MQ Everyplace network to its ultimate destination.

Figure 47 shows a simple local message put.

Figure 47. A simple local message put.


The message route is shown for a message put to (QueueManager)LocalQM destined for the (Queue)LocalQueue@LocalQM. This is clearly a put to a local queue, as the queue 'queue manager name' is the same as the name of the queue manager to which the message is put.

The message route is shown with an arrow labelled with the message route name. The arrow indicates the direction in which the message flows. The text on the label indicates the currently used target name (this can change during message resolution). LocalQM looks for a queue to accept a message for LocalQueue@LocalQM. The process of determining which queue to place a message on is called Queue Resolution. LocalQM finds an exact match for the destination, the local queue. It then puts the message onto the local queue. The message will then reside on the local queue until it is retrieved via the getMessage() API call.

Local Queue Alias

Local queues can have aliases. If we add a queue alias to the local queue we provide it with another name by which it will be known. So the local queue LocalQueue@LocalQM could be given an alias of 'LocalQueueAlias', see Figure 48.

Figure 48. LocalQueue@LocalQM with an alias of 'QueueAlias'.


Messages addressed to LocalQueueAlias@LocalQM would be directed by the queue manager to LocalQueue@LocalQM. We could envisage this as the message being placed on the matching alias, almost as if the alias were a queue, and then the alias moves the message to the correct destination, see Figure 49.

Figure 49. A message being placed on a matching alias.


The redirection of the message by the alias is accompanied by a change in the 'destination queue name' from LocalQueueAlias@LocalQM to LocalQueue@LocalQM. The fact that the message was originally put to the alias is completely lost. This can be seen by the labelling of the message route from the alias to the queue. In this particular case the change of 'put name' is of little or no importance, but when we come to discuss some more complex message resolutions it plays a larger role.

It is important to note that the resolution of the queue alias is performed just before the message is routed to the queue. The resolution is as late as it could possibly be, and is sometimes termed 'late resolution'.

Queue Manager Alias

Queue aliases allowed us to refer to queues by more than one name. Queue Manager Aliases allow us to refer to queue managers by more than one name. We can define a Queue Manager Alias 'AliasQM' referring to the local queue manager as in Figure 50.

Figure 50. Defining a queue manager alias.


Messages addressed to 'AliasQM' is routed to 'LocalQM', see Figure 51.

Figure 51. Addressing messages to a queue manager alias.


The redirection of the message by the alias is accompanied by a change in the 'destination queue name' from LocalQueue@AliasQM to LocalQueue@LocalQM. The fact that the message was originally put to the alias is completely lost. This can be seen by the labelling of the message route from the alias to the queue. Queue Manager Aliases are resolved very early during message resolution; in fact this is the first step that is performed.

Queue Manager Aliases are not much use in this scenario, but become very effective as part of more complex topologies. To complete the picture we can resolve both the Queue Manager Alias and the Queue Alias, see Figure 52.

Figure 52. Resolving the queue manager alias and the queue alias.


Here we put a message to LocalQueueAlias@AliasQM, and it is resolved first via the Queue Manager Alias, and then through the Queue Alias.

Resolution of queue manager aliases happens as soon as the request reaches a queue manager. The effect is to substitute the aliased string for the aliasing string. So for the first example above, as soon as the putMessage("AliasQM",....) call crosses the API, it is converted to a putMessage("LocalQM",....) call. This resolution is also performed when a message is put to a remote queue manager. On a remote queue manager the queue aliases on that queue manager are used, not those on the originating queue manager.

An alias can point to another alias. However, circular definitions have indeterminate results. An alias can also be made of the local queue manager name. This may not seem immediately useful, but it has a well defined purpose - it allows a queue manager to behave as if it were another queue manager. This pretence means that we can remove a queue manager entirely from the network, and by creating suitable queue manager aliases elsewhere we can allocate its workload to another queue manager. This feature is useful when modifying WebSphere MQ Everyplace network topologies, as servers, under the control of system administrators, can be moved, removed or renamed without breaking the connectivity of clients, which may not be so readily accessible.



© IBM Corporation 2002. All Rights Reserved