activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hiram Chirino" <hi...@hiramchirino.com>
Subject Re: ActiveMQ 3.2.2
Date Wed, 09 Aug 2006 13:54:58 GMT
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 <avin98@yahoo.com> 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

Mime
View raw message