The queue manager now looks for a queue to place the message on, selecting the queue with the best match according to the rules shown in Exact match, Queue alias match, S&F queue, Queue discovery, and Failure, below:
Local queue or remote queue definition where the queue name matches the destinationQueueName and the queue's queue manager name matches the destinationQueueManagerName.
The term 'queues queue manager name' needs to be explained further. For a local queue this is the same as the name of the queue manager where the queue resides. For a local queue localQ@localQM, localQM is the queue's queue manager name.
For a remote queue definition remoteQ@remoteQM residing on localQM, the queues queue manager name is remoteQM.
If a queue (remote definition or local) has a matching queue manager name and an alias and this alias matches destinationQueueName then this queue will considered a match. Effectively the put message call:
putMessage(destinationQueueManagerName, queueAliasName
is transformed to
putMessage(destinationQueueManagerName, realQueueName.
at this point. The original name of the queue used in the put call is entirely forgotten from this point on in the resolution.
If there is no exact match the queue manager searches for an inexact match. An inexact math is a Store and Forward queue that will accept messages for the given queue manager name. The search for a store and forward queue ignores the destinationQueueName. If an appropriate Store And Forward queue is found, then the message is put to it, using the destinationQueueManagerName and destinationQueueName, and the StoreAndForward queue stores the destination with the message.
If no queue has been found that will accept the message, and the message is not for a local queue, the queue manager tries to find the remote destination queue and create a remote queue definition for it automatically. This is called queue discovery. The queue manager can only perform discovery if:
If discovery is successful, the newly created remote queue definition is used. This behaves as if an exact match on a remote queue definition had been found in the first place.
The remote queue definition created by discovery is always synchronous, even if the queue to which it resolves is asynchronous, or is a Store and forward queue.