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 » Client Connections to WMQ 7 JNDI config

Post new topic  Reply to topic
 Client Connections to WMQ 7 JNDI config « View previous topic :: View next topic » 
Author Message
bamboozled_by_MQ
PostPosted: Mon Sep 20, 2010 9:07 am    Post subject: Client Connections to WMQ 7 JNDI config Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Mon Sep 20, 2010 9:34 am    Post subject: Re: Client Connections to WMQ 7 JNDI config Reply with quote

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
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Mon Sep 20, 2010 9:37 am    Post subject: Reply with quote

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
View user's profile Send private message
bamboozled_by_MQ
PostPosted: Thu Sep 23, 2010 12:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Thu Sep 23, 2010 1:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
bamboozled_by_MQ
PostPosted: Thu Sep 30, 2010 2:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Thu Sep 30, 2010 4:04 pm    Post subject: Reply with quote

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
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 » Client Connections to WMQ 7 JNDI config
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.