Example 3. Queue manager name is blank or an asterisk (*)

In this example the application is not concerned about which queue manager it connects to. The application issues an MQCONN specifying a blank queue manager name or an asterisk. A suitable channel is chosen.

This is treated in the same way as Example 1. Queue manager name includes an asterisk (*).

Note: If this application were running in an environment other than an IBM MQ MQI client, and the name was blank, it would be attempting to connect to the default queue manager. This is not the case when it is run from a client environment; the queue manager accessed is the one associated with the listener to which the channel connects. The application issues:
MQCONN ("")
or
MQCONN (*)
Following the rules, this is what happens in this instance:
  1. The client channel definition table (CCDT) is scanned in alphabetical channel name sequence, for a queue manager name that is blank, matching with the application MQCONN call.
  2. The entry for the channel name ALPHA has a queue manager name in the definition of SALE. This does not match the MQCONN call parameter, which requires the queue manager name to be blank.
  3. The next entry is for the channel name BETA.
  4. The queue manager name in the definition is SALE. Once again, this does not match the MQCONN call parameter, which requires the queue manager name to be blank.
  5. There are no further entries in the client channel definition table. The application cannot continue and receives return code MQRC_Q_MGR_NOT_AVAILABLE.

Parent topic: Examples of MQCONN calls