One small piece of functionality that was easy to miss in the deluge of new function in MQ 9.1.0 is the ability to programmatically detect if a queue manager was licensed for MQ Advanced or not. From 9.1.0 queue managers have a queue manager level attribute called ADVCAP. If a queue manager has been enabled for MQ Advanced on Distributed, or MQ Advanced VUE on z/OS, then the value of ADVCAP will be ENABLED as shown below:
This attribute can also be queried programmatically via PCF using the inquire queue manager command.
But what if you are writing a JMS application and want to know if you are connected to an MQ Advanced (MQ Advanced VUE on z/OS) queue manager? Well one approach you can take is to use PCF, but there is a simpler way. If you are using the MQ 9.1.0 JMS client you can use the following code:
//Connect to queue manager in client mode.
MQConnectionFactory cf = new MQConnectionFactory();
MQConnection c = (MQConnection) cf.createConnection();
//Prints â€śADVCAP = trueâ€ť for ADVCAP(ENABLED) queue managers,
//â€śADVCAP = falseâ€ť otherwise.
System.out.println(â€śADVCAP = c.getBooleanProperty(CommonConstants.WMQ_CAPABILITY_ADVANCED)â€ť);
There are a growing number of capabilities, for example the MQ Bridge to Blockchain, which are only available for MQ Advanced (MQ Advanced VUE on z/OS) queue managers. So being able to detect what type of queue manager you are connecting to is useful.
One thing that is worth bearing in mind is that this approach wonâ€™t work if running inside WebSphere Application Server, either traditional WAS, or WebSphere Liberty Profile.
If you have any questions about this reach out to me at firstname.lastname@example.org.