Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 76342 invoked from network); 23 May 2007 20:46:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 May 2007 20:46:24 -0000 Received: (qmail 21093 invoked by uid 500); 23 May 2007 20:46:29 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 20818 invoked by uid 500); 23 May 2007 20:46:28 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 20809 invoked by uid 99); 23 May 2007 20:46:28 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 May 2007 13:46:28 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 May 2007 13:46:21 -0700 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Hqxib-0007UJ-CR for users@activemq.apache.org; Wed, 23 May 2007 13:46:01 -0700 Message-ID: <10772424.post@talk.nabble.com> Date: Wed, 23 May 2007 13:46:01 -0700 (PDT) From: Adrian Tarau To: users@activemq.apache.org Subject: Re: Transport Exceptions close the connection In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: adrian.tarau@gmail.com References: <10722140.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Hello James, I'm switching right now to 4.1.1 and also use to failover with vm, just to be safe. Also I will remove my code, so I will not to handle connection re-creation; after that I will be back with updates :) Thanks. James.Strachan wrote: > > On 5/21/07, Adrian Tarau wrote: >> >> Hello, >> >> I have the following problem : A connection(embedded broker, vm >> transport) >> is created and then a few sessions. I poll for messages, with my own >> threads >> in order to do throttling. One thing that confuses me is : if an >> exception >> occurs somewhere in the transport(for example an interrupt on the >> consuming >> thread) , the connection is closed with all the sessions and >> consumers/producers. > > AFAIK thread interupt exceptions won't close a > connection/session/transport. You sure its not some other underlying > excpetion? > > >> I was able to listen for such an exceptions(with >> Connection.setExceptionListener(...)) and recreate the connection. I >> tried >> also with connectionFactory.setBrokerURL("failover:vm://localhost") which >> supposed to fix problems like this one, and to reconnect, but is not >> working >> as espected. > > When using vm:// you should never really need failover, since the > broker is in the same JVM. Failover is intended for use with TCP where > a remote broker may fail. > > Even if you were having a transport level exception (which shouldn't > really happen with vm:// but maybe there's a bug & we should catch & > handle InteruptedException better) then failover does the re-creation > of all the connection/sessions for you so there's no real point trying > to replicate that yourself (as you'll be opening all kinds of cans of > worms, like figuring out which messages, transactions & > acknowledgements were in progress & re-submitting them - all of which > failover: already handles. > > BTW 4.0.2 is quite old, I'd recommend upgrading to 4.1.1 > -- > James > ------- > http://macstrac.blogspot.com/ > > -- View this message in context: http://www.nabble.com/Transport-Exceptions-close-the-connection-tf3791363s2354.html#a10772424 Sent from the ActiveMQ - User mailing list archive at Nabble.com.