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)
diff --git a/src/main/csharp/MessageConsumer.cs b/src/main/csharp/MessageConsumer.cs
index d12b9d9..813aaf6 100755
--- a/src/main/csharp/MessageConsumer.cs
+++ b/src/main/csharp/MessageConsumer.cs
@@ -1810,16 +1810,22 @@
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();
+ }
}
}