Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 98885 invoked from network); 16 Apr 2011 19:10:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Apr 2011 19:10:47 -0000 Received: (qmail 97981 invoked by uid 500); 16 Apr 2011 19:10:47 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 97904 invoked by uid 500); 16 Apr 2011 19:10:47 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 97896 invoked by uid 99); 16 Apr 2011 19:10:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Apr 2011 19:10:47 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tabish121@gmail.com designates 209.85.216.43 as permitted sender) Received: from [209.85.216.43] (HELO mail-qw0-f43.google.com) (209.85.216.43) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Apr 2011 19:10:40 +0000 Received: by qwf6 with SMTP id 6so2744126qwf.2 for ; Sat, 16 Apr 2011 12:10:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:from:to:in-reply-to:references :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=TXnUCITHx7l3j0iyLV4+A+k+MpRNNAZdm+hWz5c/8r0=; b=wOVzle/rRSt27M2yE5aL8RkMNZRWHXGI3KL+3E2Zk6IsZ1btisOREghbg43e/YoMGu 1WBYQQIruodjrhptXWZIcv8rfWR8vn/FKCh/pgz672Bg2BhCTzzou/d+RrzJkiHki8hO IKdO1K7MvhoH4WtwvTEejYjJDvUyEzdFaBLrM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:in-reply-to:references:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; b=MNK7/Heq0khvAtadXTdsFhLDQKwJwaT5Ds/5D2UVKcdiRM94qtQN4TiCys+ZSdaJzi zOjhJJA3nMOKjPedV5+zauSPAFFQWcnx4ccueTuNXif8QPmGhNr03/zQu3iG42H8ls5g U50x65WmphUkSK60Stz74zCI8k0FEq/WzFYUo= Received: by 10.229.86.76 with SMTP id r12mr2343228qcl.115.1302981019403; Sat, 16 Apr 2011 12:10:19 -0700 (PDT) Received: from [192.168.2.150] (c-69-143-50-138.hsd1.va.comcast.net [69.143.50.138]) by mx.google.com with ESMTPS id s9sm2828312qco.24.2011.04.16.12.10.18 (version=SSLv3 cipher=OTHER); Sat, 16 Apr 2011 12:10:18 -0700 (PDT) Subject: Re: OnException is not being called properly From: Timothy Bish To: dev@activemq.apache.org In-Reply-To: <1302980122449-3454427.post@n4.nabble.com> References: <1302980122449-3454427.post@n4.nabble.com> Content-Type: text/plain; charset="UTF-8" Date: Sat, 16 Apr 2011 15:10:17 -0400 Message-ID: <1302981017.2743.20.camel@office> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 (2.32.2-1.fc14) Content-Transfer-Encoding: 7bit On Sat, 2011-04-16 at 11:55 -0700, archana saini wrote: > Hello, > > I have a java application which recieve messages from a queue. Everything is > working fine but onException is not being called properly. > > I am using activemq-5.3.2 and for application jdk1.6 > > In my code, i am using the connector uri:- failover:(tcp://hostname:61630) > Implemented exceptionListener and in onException ,written rerty connection > code. > > ActiveMQ is on remote server and i am running application from my local > > I was trying to see the behavious of my application when ActiveMQ is not > available or down. I tried the follwoing three scenarios:- > > 1. Disconnect network and started application, it started retrying as per > code logic. [Pass] > > 2. Started application and it connected to ActiveMQ successfully. It > consumed messages also. Now disconnected network, it works fine, it was > trying to reconnect and connected when network is available[Pass] > In logs, i can see message "WARN FailoverTransport.java > -handleTransportFailure():226 - Transport (host/host:61630) failed to > tcp://host:61630 , attempting to automatically reconnect due to: > java.net.SocketException: Connection reset > 16 Apr 2011 23:04:17 INFO FailoverTransport.java -doReconnect():878 - > Successfully reconnected to tcp://host:61630" > > 3. Started application , it connected to ActiveMQ successfully. Now > disconnected network, application stops immediately. [Fail] > Only entry in logs:- "WARN FailoverTransport.java > -handleTransportFailure():226 - Transport (host/host:61630) failed to > tcp://host:61630 , attempting to automatically reconnect due to: > java.net.SocketException: Connection reset" > But application stops immediately. > > In any test case onException method is not being called. The whole point of the failover transport is that the transport deals with network interruptions so your app doesn't see that there was a connection loss. The onException method won't be called unless you have configured the failover transport to stop trying to reconnect after a certain number of retries, etc. See the failover transport reference for configuration options: http://activemq.apache.org/failover-transport-reference.html Not sure what all your application is doing so can't say what is happening in case three there, but perhaps with the knowledge that onException isn't going to be called on network interrupt you can reevaluate you code. Regards -- Tim Bish ------------ FuseSource Email: tim.bish@fusesource.com Web: http://fusesource.com Twitter: tabish121 Blog: http://timbish.blogspot.com/ Connect at CamelOne May 24-26 The Open Source Integration Conference