Author: jgomes
Date: Tue Feb 28 23:17:13 2012
New Revision: 1294891
URL: http://svn.apache.org/viewvc?rev=1294891&view=rev
Log:
Merged revision(s) 1294890 from
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x:
Trigger the fault tolerant recovery logic when a connection exception occurs.
........
Modified:
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/ (props changed)
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Feb 28 23:17:13 2012
@@ -1,3 +1,3 @@
-/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x:1082291,1135831,1137081,1171843,1171874,1177390,1177395,1186568,1187123,1238881,1293360
+/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x:1082291,1135831,1137081,1171843,1171874,1177390,1177395,1186568,1187123,1238881,1293360,1294890
/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/tags/1.0.0:692591,693525
/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/tags/1.1.0:788230,788233,790183
Modified:
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
URL:
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs?rev=1294891&r1=1294890&r2=1294891&view=diff
==============================================================================
---
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
(original)
+++
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
Tue Feb 28 23:17:13 2012
@@ -1005,14 +1005,27 @@ namespace Apache.NMS.ActiveMQ
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);
+ }
}
}