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 » IBM MQ Java / JMS » Do you need a MQ server installation to use the MQ Java apis

Post new topic  Reply to topic
 Do you need a MQ server installation to use the MQ Java apis « View previous topic :: View next topic » 
Author Message
pgovinda
PostPosted: Thu Feb 28, 2008 12:00 pm    Post subject: Do you need a MQ server installation to use the MQ Java apis Reply with quote

Novice

Joined: 27 Feb 2008
Posts: 10

Hello -
We are writing an application, that needs to connect to remote MQ's and retrieve data from them. Its not realistic that we will have a MQ client/server wherever our application is installed.

When I just included the libraries com.ibm.mq.jar and connector.jar in my classpath, the following code works
MQEnvironment.hostname= "xxxxx"; //a remote host
MQEnvironment.channel="SYSTEM.DEF.SVRCONN";
MQEnvironment.port = 1414;
MQQueueManager qmgr = new MQQueueManager("qmgr_roma_test");

However this is not something we would want to do, since we will be accessing multiple qmanagers(on different hosts) at the same time. So I wanted to try the alternate way of connecting to a QManager
Hashtable<String,String> properties = new Hashtable<String,String>();
properties.put(MQEnvironment.hostname, "xxxxx"); //a remote host
properties.put(MQEnvironment.channel, "SYSTEM.DEF.SVRCONN");
properties.put("MQEnvironment.port", "1414");
MQQueueManager qmgr = new MQQueueManager(
"qmgr_roma_test", properties);

But this api call fails at runtime with the exception
Exception in thread "main" java.lang.UnsatisfiedLinkError: mqjbnd05 (JVMPORT015E Unable to resolve DLL references - a prerequisite DLL may be missing)

I looked in my MQ6 Client installation and the mqjbnd05.dll was nowhere to be found. But it seeems to be available in the
C:\Program Files\IBM\WebSphere MQ\Java\lib
folder of the MQ6 server installation.

So my questions are:
1. Do we absolutely need a MQ Server installation to communicate with a remote MQ using the mq java apis.
2. Pre-requiring an MQ Client/Server installation for our application is not really an option for us. So is it possible to just include some jars in the classpath and have everything working. Similar to the jdbc type 4 drivers. You dont need to have any db2 client/server installed to communicate to a remote DB2.

Thanks very much in advance for any responses and insight.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Feb 28, 2008 1:08 pm    Post subject: Re: Do you need a MQ server installation to use the MQ Java Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

pgovinda wrote:
So my questions are:
1. Do we absolutely need a MQ Server installation to communicate with a remote MQ using the mq java apis.


No. All you need is the MQClient installed (not just the jar files). There are any number of threads in here on the question of jar files v. full install. I don't understand your comment "it's not realistic to install client". It's free, and if you have a large number of target machines then it fits into whatever mechanism you're already using to distribute software.

pgovinda wrote:

2. Pre-requiring an MQ Client/Server installation for our application is not really an option for us. So is it possible to just include some jars in the classpath and have everything working. Similar to the jdbc type 4 drivers. You dont need to have any db2 client/server installed to communicate to a remote DB2.


See my comments above regarding installation of the client.

What I know about Java & jdbc would fit comfortably on the back of a fairly small envelope, but I believed you at least needed the client installed to reach a remote DB2.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
pgovinda
PostPosted: Thu Feb 28, 2008 1:29 pm    Post subject: Reply with quote

Novice

Joined: 27 Feb 2008
Posts: 10

Thanks for the response. When I meant its not realistic, I meant that our product management would think its not an out-of the box solution.

Our replication product uses MQ, and hence we already pre-req them to install MQ on the hosts where replication is setup. And we are developing tooling to monitor multiple replication environments in one place, and hence the tool need not be installed on the machines where replication is setup.
Now its not so great to ask the user to install the client again if he needs to use the tool.

And also like I mentioned, I downloaded the MQ Client V6 from
https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?source=wsmqc60

and in my installation directory, I do not see the file mqjbnd05.dll
which is causing the unsatisfied link error.
Do you think thats a problem with my installation or this file is not part of the client?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Feb 28, 2008 2:34 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Your code is trying to make a bindings connection, which requires the MQ Server install.

Your code can, instead, make a client connection, which in practice only requires com.ibm.mq.jar, although generally should have the full MQ Client installed.

It's a difference in what information you supply about where the queue manager is.


_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
pgovinda
PostPosted: Thu Feb 28, 2008 5:39 pm    Post subject: Reply with quote

Novice

Joined: 27 Feb 2008
Posts: 10

Thanks for the pointer.
I had to change the property to include the transport-type=MQSeries client.
And also previously since I constructed my Hashtable as a typed one (hashtable<string,string>), I was setting the portNumber as string "1413". I guess that didnt work, and it looked like the mq apis defaulted to connecting to port 0. Now my hashtable is not typed anymore.

So the following works with just including the com.ibm.mq.jar and connector.jar in the classpath!

Hashtable properties = new Hashtable();
properties.put(MQC.HOST_NAME_PROPERTY, "xxxx");
properties.put(MQC.CHANNEL_PROPERTY, "SYSTEM.DEF.SVRCONN");
properties.put(MQC.PORT_PROPERTY, 1413);
properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES_CLIENT);

MQQueueManager qmgr = new MQQueueManager ("qmgr_roma_test",properties);

The above qmanager is on windows, but I hope it should'nt be any different for z/os, and if I set the above parameters and just include the 2 jar files I should be able to connect to a q-manager on z/os. If people have had other experiences, it would good to know.

Also I am assuming that having the MQ Client installed is the ofically supported way of using the java apis, but just including the jars also works?

And to clarify one of the previous posts, DB2 Type 2 drivers require a client installation. But DB2 Type 4 drivers which have been around for a while do not require db2 client libraries to communicate to a remote DB2.

Thanks
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Feb 28, 2008 7:56 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Connect to zOS? Only if you have the client attachment facility (CAF) or if you are running under zLinux...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Fri Feb 29, 2008 12:41 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

pgovinda wrote:
The above qmanager is on windows, but I hope it should'nt be any different for z/os, and if I set the above parameters and just include the 2 jar files I should be able to connect to a q-manager on z/os. If people have had other experiences, it would good to know.


Yes it is. The z/OS platform doesn't support client connections without the CAF component. Speak to your sys prog.

pgovinda wrote:

Also I am assuming that having the MQ Client installed is the ofically supported way of using the java apis, but just including the jars also works?


Correct. I'd prefer "has been found to work" but that's just hair splitting. Certainly if you get a problem just using the jars & end up raising a PMR, I'd make a small wager I know what the first response would be.

pgovinda wrote:
And to clarify one of the previous posts, DB2 Type 2 drivers require a client installation. But DB2 Type 4 drivers which have been around for a while do not require db2 client libraries to communicate to a remote DB2.


Behold my Java knowledge expanding.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Fri Feb 29, 2008 7:32 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Vitor wrote:
pgovinda wrote:

Also I am assuming that having the MQ Client installed is the ofically supported way of using the java apis, but just including the jars also works?


Correct. I'd prefer "has been found to work" but that's just hair splitting. Certainly if you get a problem just using the jars & end up raising a PMR, I'd make a small wager I know what the first response would be.

Hope it was a real small wager I've opened a couple PMRs over the years and it never was an issue. The built in JMS tracing gave IBM support what they needed and they never asked if the full client was installed.

Intersting session at Impact this year:
Quote:
CFT-2778 - Feedback session: Does size really matter? and other questions related to IBM WebSphere MQ packaging and deployment If you are an IBM WebSphere® MQ administrator, we would like to understand how you install and deploy IBM WebSphere MQ components. For example, how do your client applications meet their dependencies for the IBM WebSphere MQ client libraries? Which components need to be available for download and what size is acceptable? How many people in your organization need to install the IBM WebSphere MQ explorer or the IBM WebSphere MQ development toolkit? Does everyone have access to installation media or the SupportPac Web site? Your input to this session can help us to improve the packaging and distribution of IBM WebSphere MQ components.
Level: Intermediate

_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Feb 29, 2008 7:37 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

PeterPotkay wrote:
Hope it was a real small wager


Real small - my entire bonus for 2007.

PeterPotkay wrote:
Intersting session at Impact this year:
Quote:
CFT-2778 - Feedback session: Does size really matter? and other questions related to IBM WebSphere MQ packaging and deployment If you are an IBM WebSphere® MQ administrator, we would like to understand how you install and deploy IBM WebSphere MQ components. For example, how do your client applications meet their dependencies for the IBM WebSphere MQ client libraries? Which components need to be available for download and what size is acceptable? How many people in your organization need to install the IBM WebSphere MQ explorer or the IBM WebSphere MQ development toolkit? Does everyone have access to installation media or the SupportPac Web site? Your input to this session can help us to improve the packaging and distribution of IBM WebSphere MQ components.
Level: Intermediate


I've so got to get to Impact & nip this sort of thing in the bud. Reduced software installation requirements could put huge numbers of flying monkeys out of a job....
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
pgovinda
PostPosted: Tue Mar 04, 2008 5:50 pm    Post subject: Reply with quote

Novice

Joined: 27 Feb 2008
Posts: 10

Thanks very much for all your opinions. I asked around and it looks like people using MQ for our application usually have CAF as well! So thats a good start
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 » IBM MQ Java / JMS » Do you need a MQ server installation to use the MQ Java apis
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.