Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 65749 invoked from network); 6 Jul 2006 06:41:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Jul 2006 06:41:56 -0000 Received: (qmail 36978 invoked by uid 500); 6 Jul 2006 06:41:56 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 36806 invoked by uid 500); 6 Jul 2006 06:41:55 -0000 Mailing-List: contact activemq-users-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-users@geronimo.apache.org Delivered-To: mailing list activemq-users@geronimo.apache.org Received: (qmail 36788 invoked by uid 99); 6 Jul 2006 06:41:55 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jul 2006 23:41:55 -0700 X-ASF-Spam-Status: No, hits=0.8 required=10.0 tests=DNS_FROM_RFC_ABUSE,MAILTO_TO_SPAM_ADDR,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of james.strachan@gmail.com designates 66.249.92.171 as permitted sender) Received: from [66.249.92.171] (HELO ug-out-1314.google.com) (66.249.92.171) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jul 2006 23:41:54 -0700 Received: by ug-out-1314.google.com with SMTP id m3so178599uge for ; Wed, 05 Jul 2006 23:41:33 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=CqNPGIj+7gmV4G4+f3Ld7PCET4dqjTFpMt055KV9/CrUE5s1+t7ZbzdzpA5IvsAnpjzzUQlNL273j4JUVmot69aoJWmRmAypF7qPwlG3DC7QLWHHGCBLdEczzFrm1GqiXrUMwZRnvFDPQc3Lyu3BSbXptDsAQWDNpULSxAulB0A= Received: by 10.66.220.17 with SMTP id s17mr302525ugg; Wed, 05 Jul 2006 23:41:33 -0700 (PDT) Received: by 10.66.224.1 with HTTP; Wed, 5 Jul 2006 23:41:33 -0700 (PDT) Message-ID: Date: Thu, 6 Jul 2006 07:41:33 +0100 From: "James Strachan" To: activemq-users@geronimo.apache.org Subject: Re: How to post messages to the same queue in a Cluster In-Reply-To: <5192257.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <5192257.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I don't quite understand the question. BTW notes on implementing request-response here... http://incubator.apache.org/activemq/how-should-i-implement-request-response-with-jms.html why do you care what the hostname of the broker you are connected to is? If you are connecting to a master/slave pair of brokers to achieve failover & high availability (which I assume is why you want a cluster) its the same logical queue whether you connect to the master or the slave http://incubator.apache.org/activemq/masterslave.html On 7/6/06, avin98 wrote: > > Hi, > > 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 = > (QueueConnectionFactory) > naming.lookup(connectionFactoryName); > > > // create jms connection > QueueConnection connection = > connectionFactory.createQueueConnection(); > > System.out.println("Connection is:"+ connection); > > // lookup jms queue > Queue queue = (Queue) naming.lookup(queueName); > > Now, for the first time I do the lookup ...is 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: http://www.nabble.com/How-to-post-messages-to-the-same-queue-in-a-Cluster-tf1898012.html#a5192257 > Sent from the ActiveMQ - User forum at Nabble.com. > > -- James ------- http://radio.weblogs.com/0112098/