Author: tabish
Date: Wed Jul 16 20:16:18 2014
New Revision: 1611170

URL: http://svn.apache.org/r1611170
Log:
https://issues.apache.org/jira/browse/AMQNET-483

Ensure the the ConsumerCloseSynchronization doesn't try to close the same 
consumer more than once.

Fixes [AMQNET-AMQNET-483]. (See 
https://issues.apache.org/jira/browse/AMQNET-AMQNET-483)

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/   (props 
changed)
    
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/main/csharp/MessageConsumer.cs

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/
------------------------------------------------------------------------------
  Merged /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk:r1611168

Modified: 
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/main/csharp/MessageConsumer.cs
URL: 
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/main/csharp/MessageConsumer.cs?rev=1611170&r1=1611169&r2=1611170&view=diff
==============================================================================
--- 
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/main/csharp/MessageConsumer.cs
 (original)
+++ 
activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/main/csharp/MessageConsumer.cs
 Wed Jul 16 20:16:18 2014
@@ -1810,16 +1810,22 @@ namespace Apache.NMS.ActiveMQ
 
                        public void AfterCommit()
                        {
-                Tracer.DebugFormat("ConsumerCloseSynchronization - AfterCommit 
Called for Consumer {0}.",
-                                   this.consumer.ConsumerId);
-                this.consumer.DoClose();
+                if (!this.consumer.Closed) 
+                {
+                    Tracer.DebugFormat("ConsumerCloseSynchronization - 
AfterCommit Called for Consumer {0}.",
+                                       this.consumer.ConsumerId);
+                    this.consumer.DoClose();
+                }
                        }
 
                        public void AfterRollback()
                        {
-                Tracer.DebugFormat("ConsumerCloseSynchronization - 
AfterRollback Called for Consumer {0}.",
-                                   this.consumer.ConsumerId);
-                this.consumer.DoClose();
+                if (!this.consumer.Closed) 
+                {
+                    Tracer.DebugFormat("ConsumerCloseSynchronization - 
AfterRollback Called for Consumer {0}.",
+                                       this.consumer.ConsumerId);
+                    this.consumer.DoClose();
+                }
                        }
                }
 


Reply via email to