Author |
Message
|
bamboozled_by_MQ |
Posted: Mon Sep 20, 2010 9:07 am Post subject: Client Connections to WMQ 7 JNDI config |
|
|
Voyager
Joined: 07 Jan 2004 Posts: 75
|
Hello All,
I want to use the Client MQ jars and connect to a different server running WMQ7 server. I have created the SVRCONN on the WMQ qmgr etc and verified the cmd server and listeners are running.
However I need the JNDI Context Factory and Provider URL for my program to connect to get the connfactory but I am unsure how to set this on the WMQ7 side. In some initial testing I just used the sun RefFS package for initial context and File for JNDI and it works great, but thats local. In the real scenario the client wont be local so I cannot use the file based and ldap isnt an option so needed some help with these. I thought they would be something like:
com.ibm.mq.jms.context.WMQInitialContextFactory
and tcp://10.123.34.334:1414/SYSTEM.ADMIN.SVRCONN ??
any help is greatly appreciated. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Sep 20, 2010 9:34 am Post subject: Re: Client Connections to WMQ 7 JNDI config |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
bamboozled_by_MQ wrote: |
Hello All,
I want to use the Client MQ jars and connect to a different server running WMQ7 server. I have created the SVRCONN on the WMQ qmgr etc and verified the cmd server and listeners are running.
However I need the JNDI Context Factory and Provider URL for my program to connect to get the connfactory but I am unsure how to set this on the WMQ7 side. In some initial testing I just used the sun RefFS package for initial context and File for JNDI and it works great, but thats local. In the real scenario the client won't be local so I cannot use the file based and ldap isnt an option so needed some help with these. I thought they would be something like:
com.ibm.mq.jms.context.WMQInitialContextFactory
and tcp://10.123.34.334:1414/SYSTEM.ADMIN.SVRCONN ??
any help is greatly appreciated. |
Of course you can still use file based JNDI. You just need to make the .bindings file available to the client. (ftp, copy, jumpdrive...)
Remember as well to setup the connection factories with client connections.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Sep 20, 2010 9:37 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
And let's be very very clear about what the WMQInitialContextFactory DOES and IS.
It pretends that your queue manager is actually your JNDI server.
You don't want this. It breaks the logical separation of JNDI resources from the physical definition of those resources.
You really really do want to use the FileContext or some other JNDI server, and either keep the file local to the client app (as part of it's config) or in an OpenLDAP or etc. location. |
|
Back to top |
|
 |
bamboozled_by_MQ |
Posted: Thu Sep 23, 2010 12:08 pm Post subject: |
|
|
Voyager
Joined: 07 Jan 2004 Posts: 75
|
Thank you very much. I have setup the WMQ Server on a node with WAS. Within WAS, I have created the connectionfactory entries etc. and listed the JNDI names as jms/MYCF etc.
so on the client side the two entries I need to lookup are?
JNDI Context Factory = com.ibm.mq.jms.context.WMQInitialContextFactory
JNDI Provider URL =Â 123.23.23.233:1414/SYSTEM.ADMIN.SVRCONN
thanks again. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Sep 23, 2010 1:14 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
bamboozled_by_MQ wrote: |
Thank you very much. I have setup the WMQ Server on a node with WAS. Within WAS, I have created the connectionfactory entries etc. and listed the JNDI names as jms/MYCF etc.
so on the client side the two entries I need to lookup are?
JNDI Context Factory = com.ibm.mq.jms.context.WMQInitialContextFactory
JNDI Provider URL =Â 123.23.23.233:1414/SYSTEM.ADMIN.SVRCONN |
NO.
You have configured WAS as the JNDI service. You need, therefore, to specify the necessary information to connect to the WAS JNDI service.
And NOT specify information to connect to the queue manager, to ask it to act as a JNDI service. |
|
Back to top |
|
 |
bamboozled_by_MQ |
Posted: Thu Sep 30, 2010 2:48 pm Post subject: |
|
|
Voyager
Joined: 07 Jan 2004 Posts: 75
|
Makes sense.
So I would use
com.ibm.websphere.naming.WsnInitialContextFactory
iiop:10.123.44.22:1414
this uses the WAS JNDI service, the first two I described used WMQ file based and WMQ JNDI "service"
So on the client side, I do not have the com.ibm.websphere.naming.WsnInitialContextFactory, what is happening is the client is actually using the WAS servers JNDI server that does have the jar in this case right. I was confused that it must have the com.ibm.websphere.naming.WsnInitialContextFactory locally too. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Sep 30, 2010 4:04 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Okay.
All three JNDI services are entirely separate. You can not define resources in one JNDI service and then use another JNDI services classes to connect or inquire on those.
If you want to connect to the WAS JNDI, then you must provide enough of the WAS stack - possibly the WAS App Client, perhaps there is something lighter weight these days - on the client side so it can connect to that.
If you just want to connect to the queue manager, without any knowledge of WAS at all, then the *best* way is to use the File Context and create a local file that is the local JNDI on the client. This isn't hard to do and it doesn't require that you do anything with WAS or MQ really at all.
If you would rather not manage this file, which is really not effort, then you can use the WMQ Initial Context which then pretends that the queue manager is itself the JNDI server. But in order to do that, you have to put the necessary information into the client config to fully identify how to connect to the queue manager in the first place. |
|
Back to top |
|
 |
|