Author |
Message
|
Gargo |
Posted: Mon Apr 19, 2021 11:37 pm Post subject: Retrieving connected server version from connection |
|
|
Newbie
Joined: 19 Apr 2021 Posts: 1
|
Hi,
I have a java program that creates a MQQueueConnection.
Is there any way to know in witch version is the server I'm connecting to?
I mean, I have tries to read all connection metadata, but no info about server version is provided.
Thanks |
|
Back to top |
|
 |
tczielke |
Posted: Tue Apr 20, 2021 6:27 am Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
You should be able to get the IBM MQ queue manager version with JMS code like this:
Code: |
MQConnection connection = (MQConnection)mqFactory.createConnection();
ConnectionMetaData metadata = connection.getMetaData();
System.out.println("JMS Provider: " + metadata.getJMSProviderName());
System.out.println("JMS Provider Version: " + metadata.getProviderMajorVersion() + "." + metadata.getProviderMinorVersion());
|
However, it looks like IBM MQ still has an older version in that meta data. Below is what was in the metadata using an IBM MQ 9.2 com.ibm.mqjms.jar.
Quote: |
JMS Provider: IBM MQ JMS Provider
JMS Provider Version: 8.0
|
So you probably need to have an APAR open with IBM MQ to get this corrected. In the meantime, the data seems to be inaccurate. _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Apr 20, 2021 8:17 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Generally, apps should be agnostic to infrastructure, middleware and o/s VRMs. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
gbaddeley |
Posted: Tue Apr 20, 2021 4:23 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
bruce2359 wrote: |
Generally, apps should be agnostic to infrastructure, middleware and o/s VRMs. |
Agree. I'm not aware of any situation where an app would need to know the MQ version. _________________ Glenn |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Apr 20, 2021 6:29 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
gbaddeley wrote: |
bruce2359 wrote: |
Generally, apps should be agnostic to infrastructure, middleware and o/s VRMs. |
Agree. I'm not aware of any situation where an app would need to know the MQ version. |
I’ve heard this in design discussions where developers would like their apps to make use of a new feature - if it is available. If you want the new feature, I tell them, then make the new feature version a prerequisite. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Apr 20, 2021 9:44 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
tczielke wrote: |
You should be able to get the IBM MQ queue manager version with JMS code like this:
Code: |
MQConnection connection = (MQConnection)mqFactory.createConnection();
ConnectionMetaData metadata = connection.getMetaData();
System.out.println("JMS Provider: " + metadata.getJMSProviderName());
System.out.println("JMS Provider Version: " + metadata.getProviderMajorVersion() + "." + metadata.getProviderMinorVersion());
|
However, it looks like IBM MQ still has an older version in that meta data. Below is what was in the metadata using an IBM MQ 9.2 com.ibm.mqjms.jar.
Quote: |
JMS Provider: IBM MQ JMS Provider
JMS Provider Version: 8.0
|
So you probably need to have an APAR open with IBM MQ to get this corrected. In the meantime, the data seems to be inaccurate. |
You could also request the qmgr's cmd level in a pcf message...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
RogerLacroix |
Posted: Wed Apr 21, 2021 9:59 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
This looks like the same question that was asked at StackOverflow.
I posted how to get the MQ JAR version and Mark Taylor posted how to get the queue manager command level from JMS.
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
tczielke |
Posted: Wed Apr 21, 2021 12:15 pm Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
It isn't clear what are all the requirements here. A JMS application should be able to get the ConnectionMetaData from the object that represents a connection and find the JMS provider's version. This is portable code that will work regardless of the JMS provider (e.g. IBM MQ, ActiveMQ, etc.). It is in the JMS specification here:
Quote: |
6.1.6. ConnectionMetaData
All the objects that represent a connection provide a ConnectionMetaData object. This object provides the latest version of JMS supported by the provider as well as the provider’s product name and version.
It also provides a list of the JMS defined property names supported by the connection. |
As mentioned before, IBM MQ has not been keeping up with the specification since IBM MQ 8.0, from what I have observed. _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
gbaddeley |
Posted: Wed Apr 21, 2021 3:38 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
bruce2359 wrote: |
gbaddeley wrote: |
bruce2359 wrote: |
Generally, apps should be agnostic to infrastructure, middleware and o/s VRMs. |
Agree. I'm not aware of any situation where an app would need to know the MQ version. |
I’ve heard this in design discussions where developers would like their apps to make use of a new feature - if it is available. If you want the new feature, I tell them, then make the new feature version a prerequisite. |
Surely an app would not test the MQ version to decide if a feature was available or not, and then use various version dependent logic? 45 years of computer programming tells me this is not a good idea. _________________ Glenn |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Apr 23, 2021 11:16 am Post subject: Re: Retrieving connected server version from connection |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Gargo wrote: |
Is there any way to know in witch version is the server I'm connecting to? |
What is the business requirement? What will your app do with this information? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Fri Apr 23, 2021 2:49 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
I posted a blog item on how to programmatically get IBM MQ version for both client and queue manager for both Java and Java/JMS applications. See here.
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
gbaddeley |
Posted: Sun Apr 25, 2021 3:33 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
RogerLacroix wrote: |
I posted a blog item on how to programmatically get IBM MQ version for both client and queue manager for both Java and Java/JMS applications. See here.
Regards, Roger Lacroix
Capitalware Inc. |
Thanks Roger. Very thorough as usual, including the justified digs at IBM. _________________ Glenn |
|
Back to top |
|
 |
|