简体   繁体   中英

MQ Queue manager alias

In our application we are maintaining queue manager names in the configuration file which are stored in database. At any time, only one queue manager name can be specified in the configuration file.

To support application fail over, it is required to connect to another queue manager with a different name.

It makes no sense to duplicate all configuration files due to different queue manager name. Is there any way at MQ level ( alias may be) to refer with the same queue manager in the configuration file, but if the DR location is active it should connect to new queue manager.

As JoshMc said, use a blank or star for the queue manager name. After the connection, the application can use the getName method to retrieve the name of the queue manager.

MQQueueManager qMgr = new MQQueueManager(" ", mqht);
System.out.println("QMgr="+qMgr.getName());

Note: mqht is a Hashtable with the connection parameters.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM