ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General Discussion » Retrieving connected server version from connection

Post new topic  Reply to topic
 Retrieving connected server version from connection « View previous topic :: View next topic » 
Author Message
Gargo
PostPosted: Mon Apr 19, 2021 11:37 pm    Post subject: Retrieving connected server version from connection Reply with quote

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
View user's profile Send private message
tczielke
PostPosted: Tue Apr 20, 2021 6:27 am    Post subject: Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 939
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
View user's profile Send private message
bruce2359
PostPosted: Tue Apr 20, 2021 8:17 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
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
View user's profile Send private message
gbaddeley
PostPosted: Tue Apr 20, 2021 4:23 pm    Post subject: Reply with quote

Jedi

Joined: 25 Mar 2003
Posts: 2492
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
View user's profile Send private message
bruce2359
PostPosted: Tue Apr 20, 2021 6:29 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
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
View user's profile Send private message
fjb_saper
PostPosted: Tue Apr 20, 2021 9:44 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
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
View user's profile Send private message Send e-mail
RogerLacroix
PostPosted: Wed Apr 21, 2021 9:59 am    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3252
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
View user's profile Send private message Visit poster's website
tczielke
PostPosted: Wed Apr 21, 2021 12:15 pm    Post subject: Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 939
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
View user's profile Send private message
gbaddeley
PostPosted: Wed Apr 21, 2021 3:38 pm    Post subject: Reply with quote

Jedi

Joined: 25 Mar 2003
Posts: 2492
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
View user's profile Send private message
bruce2359
PostPosted: Fri Apr 23, 2021 11:16 am    Post subject: Re: Retrieving connected server version from connection Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
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
View user's profile Send private message
RogerLacroix
PostPosted: Fri Apr 23, 2021 2:49 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3252
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
View user's profile Send private message Visit poster's website
gbaddeley
PostPosted: Sun Apr 25, 2021 3:33 pm    Post subject: Reply with quote

Jedi

Joined: 25 Mar 2003
Posts: 2492
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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » Retrieving connected server version from connection
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.