activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From avin98 <>
Subject How to post messages to the same queue in a Cluster
Date Thu, 06 Jul 2006 01:07:16 GMT


I am trying to develop an application which involves quite a number of
round-trips. Basically I need to post messages to a particular queue, and
receive messages out of a particular queue.

These queues are to be in a cluster. 

My question is how do I obtain connection to the same queue, everytime.

The code i have is:

InitialContext naming = new InitialContext();
            // lookup queue connection factory
            QueueConnectionFactory connectionFactory =

            // create jms connection
            QueueConnection connection =
            System.out.println("Connection is:"+ connection);
            // lookup jms queue
            Queue queue = (Queue) naming.lookup(queueName);

Now, for the first time I do the lookup there anyway I can store the
hostname of the queue, and get the Queue corresponding to the hostname next
time onwards ???
View this message in context:
Sent from the ActiveMQ - User forum at

View raw message