Skip to content
Permalink
Browse files
Merged revision(s) 1294897 from activemq/activemq-dotnet/Apache.NMS.S…
…tomp/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)

........
  • Loading branch information
Jim Gomes committed Feb 28, 2012
1 parent dc4c097 commit 3fe1caeff126757205794343f5403cb3dc5030cc
Showing 1 changed file with 19 additions and 6 deletions.
@@ -729,14 +729,27 @@ private void AsyncCallExceptionListener(object error)

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);
}
}
}

0 comments on commit 3fe1cae

Please sign in to comment.