There's a good FAQ entry on this...
http://incubator.apache.org/activemq/how-do-i-create-new-destinations.html
On 8/9/06, Hiram Chirino <[EMAIL PROTECTED]> wrote:
Think of Queue and Topic objects like URI objects. They only are used
as identifiers for the destinations that message are sent to or
received from. So Queues are not not bound to a specific server (They
don't contain server specific information).
So I don't understand why you say Queue1 is bound to Server1.
Regards,
Hiram
On 8/8/06, avin98 <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I have 2 Geronimo servers running on different boxes ...with the same
> application resources.
>
> I have a JMS Queue & a JMS Connection factory running on Box1 & Box2.
>
> From Box 1, I try to connect to a JMS resource on Box 2, it fails.
>
> Here is my code
>
> public Queue getRequestQueue(String hostName) {
>
> if(hostName == null || hostName.length()==0)
> return getRequestQueue();
>
> Hashtable env = new Hashtable();
> env.put(Context.INITIAL_CONTEXT_FACTORY,
> "org.activemq.jndi.ActiveMQInitialContextFactory");
> env.put(Context.PROVIDER_URL, "tcp://server2:61616");
> env.put(Context.SECURITY_PRINCIPAL,"geronimo");
> env.put(Context.SECURITY_CREDENTIALS,"geronimo");
>
> System.out.println("| ..........................................
|");
> System.out.println("| The Hostname getRequestQueue for
connection
> is:"+hostName);
> System.out.println("| ..........................................
|");
>
> try {
> InitialContext naming = new InitialContext(env);
> return (Queue) naming.lookup("Queue1");
> } catch(NamingException e){
> e.printStackTrace();
> return null;
> }
> }
>
>
> I always get the Queue1 object which is bound to Server1 instead of getting
> the object bound to Server2.
>
> Is there anything i am doing wrong here ?
> --
> View this message in context:
http://www.nabble.com/ActiveMQ-3.2.2-tf2074683.html#a5713245
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>
--
Regards,
Hiram
Blog: http://hiramchirino.com
--
James
-------
http://radio.weblogs.com/0112098/