Author |
Message
|
sbuster |
Posted: Wed Oct 22, 2008 4:41 pm Post subject: Which InitialContext to use from Remote Server |
|
|
Apprentice
Joined: 07 Oct 2008 Posts: 25
|
I would like to connect to an MQ server using JMS + JNDI. What JNDI Context would I use from MQ, and what I would use with a Client? Would I still use the old WMQIntialContextFactory class from MQ 6.
Thanks |
|
Back to top |
|
 |
atheek |
Posted: Wed Oct 22, 2008 9:05 pm Post subject: |
|
|
 Partisan
Joined: 01 Jun 2006 Posts: 327 Location: Sydney
|
If you search this forum you will see many reasons why its not advisable to use WMQIntialContextFactory
Better use file based JNDI and com.sun.jndi.fscontext.RefFSContextFactory |
|
Back to top |
|
 |
sbuster |
Posted: Thu Oct 23, 2008 2:53 am Post subject: |
|
|
Apprentice
Joined: 07 Oct 2008 Posts: 25
|
So if I have an application on server A trying to connect MQ on server B, how would I access the .bindings file? I sure hope I wouldn't have to copy that file to server A. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Oct 23, 2008 3:15 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Why do you hope that? Why is that a problem? What is "network storage" good for, anyway?
If you are using a JEE application server or a JEE application client, you should be using it's JNDI and not anything else.
If you are using a standalone JMS application, that is not running in a JEE container, then you should use a JNDI provider that makes the most sense for you.
The WMQ JNDI provider (that runs under the WMQInitialContext) is not considered a great choice because it does not provide a logical separation between JNDI names and actual WMQ object names - they are the same name no matter what. |
|
Back to top |
|
 |
sbuster |
Posted: Thu Oct 23, 2008 3:38 am Post subject: |
|
|
Apprentice
Joined: 07 Oct 2008 Posts: 25
|
Your assumption is I have the ability for network storage, bad assumption for various unrelated reasons. Also, copying this file around is a very bad idea because it would obviously need to be copied every time it change, bad idea.
My question is, "Is there a network friendly way of accessing MQ via JNDI?". |
|
Back to top |
|
 |
manicminer |
Posted: Thu Oct 23, 2008 4:49 am Post subject: |
|
|
 Disciple
Joined: 11 Jul 2007 Posts: 177
|
You could use an LDAP server and the LDAP context factory:
com.sun.jndi.ldap.LdapCtxFactory
Just stick your ldap server some place you can access. OpenLDAP should work just fine and is free.
Of course you need to ensure you secure your ldap
The MQ Explorer should be able to allow you to easily create and manage your definitions from LDAP too. |
|
Back to top |
|
 |
|