How to access the right broker in a multi broker envt.
On my server there are two different broker instances running on two different ports (7676 & 9000). The broker running on the default port is instantiated by a third party software/server. So I created a new broker for port 9000 and want my application to access this broker. I also created a Queue Destination object, queue and queue connection factory objects. When I do a lookup for the queue connection factory I get a NameNotFoundException. I dont have much knowledge on this subject and I guess the application is looking at the wrong broker instance. How do I fix this problem and is there any way to modify the application lookup routine so that it looks at the correct broker instance.
thankyou very much for any help.
Hugo
##### Exception Level:JNDI lookup failed for (new) :XXXQueueConnectionFactory:
javax.naming.NameNotFoundException: MMIQueueConnectionFactory
at com.sun.jndi.fscontext.RefFSContext.getObjectFromBindings(RefFSContext.java:400 )
at com.sun.jndi.fscontext.RefFSContext.lookupObject(RefFSContext.java:327)
at com.sun.jndi.fscontext.RefFSContext.lookup(RefFSContext.java:146)
at com.sun.jndi.fscontext.FSContext.lookup(FSContext.java:127)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
[1302 byte] By [
hug0victor] at [2007-11-25 17:26:16]

# 1
Hi there.
Well, I don't think the problem here is with wrong broker instance but it is with the way you are looking up the object.
Now, for the client runtime to get connection to the right broker, you need to specify the broker host name and port in the "imqAddressList" attribute of the ConnectionFactory. I am sure you would have already done this. After this, if you correctly look up the object, you should get connection to the right broker.
Thanks.
--
Sagar
http://wwws.sun.com/software/products/message_queue
# 2
Hello Sagar,
may be i did not explain my situation clearly. When I said multi broker it is not exactly multibroker in one single MQ envt(like clustering). The default port is occupied by the third party MQ software and since I cannot touch this MQ and add new objects I installed a new IMQ (3.0.1) and created a broker on port 9000. I created a new connection factory and queue and I want to point my application to this new connection factory. How do I configure my application to look at the broker on port 9000 instead of the default port. In ur earlier reply you may have pointed me in the right direction but I dont know how to add the imqAddressList attribute. I looked at the API and didnt see any method in QueueConnectionFactory to configure that. I am just getting my feet wet on this subject so please bear with me.
thank you so much for your time and help.
regards
Hugo
# 3
Hi Sagar,
I guess we can set the imqAddressList property after getting the QueueConnectionFactory object. But my application fails when I lookup for the QueueConnectionFactory object. One more thing if I run a sample program all by itself the lookup works but if I do the lookup from my application it fails. I am looking for the same connection factory in both situations, one works and the other fails.
Here is the exception i get when I try to lookup from my application.
javax.naming.NameNotFoundException: MMIQueueConnectionFactory
at com.sun.jndi.fscontext.RefFSContext.getObjectFromBindings(RefFSContext.java:400 )
at com.sun.jndi.fscontext.RefFSContext.lookupObject(RefFSContext.java:327)
at com.sun.jndi.fscontext.RefFSContext.lookup(RefFSContext.java:146)
at com.sun.jndi.fscontext.FSContext.lookup(FSContext.java:127)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
# 4
When you store your QueueConnectionFactory using
imqobjmgr what string are you using for the lookup name?
And then in your code when you do ctx.lookup(<the lookup name>)
what are you using as the lookup name when you try to
lookup the connection factory?
Chris
kasso at 2007-7-3 13:12:49 >
