Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BAD6E91C3 for ; Tue, 28 Feb 2012 23:43:54 +0000 (UTC) Received: (qmail 76116 invoked by uid 500); 28 Feb 2012 23:43:54 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 76079 invoked by uid 500); 28 Feb 2012 23:43:54 -0000 Mailing-List: contact commits-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 commits@activemq.apache.org Received: (qmail 76071 invoked by uid 99); 28 Feb 2012 23:43:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Feb 2012 23:43:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Feb 2012 23:43:53 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C50262388900 for ; Tue, 28 Feb 2012 23:43:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1294898 - in /activemq/activemq-dotnet/Apache.NMS.Stomp/trunk: ./ src/main/csharp/Connection.cs Date: Tue, 28 Feb 2012 23:43:33 -0000 To: commits@activemq.apache.org From: jgomes@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120228234333.C50262388900@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jgomes Date: Tue Feb 28 23:43:33 2012 New Revision: 1294898 URL: http://svn.apache.org/viewvc?rev=1294898&view=rev Log: Merged revision(s) 1294897 from activemq/activemq-dotnet/Apache.NMS.Stomp/branches/1.5.x: Trigger the fault tolerant recovery logic when a connection exception occurs. Fixes [AMQNET-371]. (See https://issues.apache.org/jira/browse/AMQNET-371) ........ Modified: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/ (props changed) activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Connection.cs Propchange: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Feb 28 23:43:33 2012 @@ -1 +1 @@ -/activemq/activemq-dotnet/Apache.NMS.Stomp/branches/1.5.x:1135832,1137086 +/activemq/activemq-dotnet/Apache.NMS.Stomp/branches/1.5.x:1135832,1137086,1294897 Modified: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Connection.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Connection.cs?rev=1294898&r1=1294897&r2=1294898&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Connection.cs (original) +++ activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Connection.cs Tue Feb 28 23:43:33 2012 @@ -729,14 +729,27 @@ namespace Apache.NMS.Stomp internal void OnException(Exception error) { - // Will fire an exception listener callback if there's any set. - OnAsyncException(error); + if(this.transport.IsFaultTolerant) + { + Tracer.ErrorFormat("Attempting recovery from Exception: {0}", error.Message); + while(null != (error = error.InnerException)) + { + Tracer.ErrorFormat(" {0}", error.Message); + } - if(!this.closing.Value && !this.closed.Value) + OnTransportInterrupted(this.transport); + } + else { - // Perform the actual work in another thread to avoid lock contention - // and allow the caller to continue on in its error cleanup. - executor.QueueUserWorkItem(AsyncOnExceptionHandler, error); + // Will fire an exception listener callback if there's any set. + OnAsyncException(error); + + if(!this.closing.Value && !this.closed.Value) + { + // Perform the actual work in another thread to avoid lock contention + // and allow the caller to continue on in its error cleanup. + executor.QueueUserWorkItem(AsyncOnExceptionHandler, error); + } } }