You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2009/11/23 20:54:27 UTC

svn commit: r883475 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs

Author: tabish
Date: Mon Nov 23 19:54:23 2009
New Revision: 883475

URL: http://svn.apache.org/viewvc?rev=883475&view=rev
Log:
Fix an edge case where we could end up sending a delivered ack after the client had already acked the message

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs?rev=883475&r1=883474&r2=883475&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs Mon Nov 23 19:54:23 2009
@@ -700,7 +700,17 @@
 				}
 				else if(this.session.IsClientAcknowledge || this.session.IsIndividualAcknowledge)
 				{
-					AckLater(dispatch, AckType.DeliveredAck);
+					bool messageAckedByConsumer = false;
+					
+					lock(this.dispatchedMessages)
+					{
+						messageAckedByConsumer = this.dispatchedMessages.Contains(dispatch);
+					}
+					
+					if(messageAckedByConsumer)
+					{					
+						AckLater(dispatch, AckType.DeliveredAck);
+					}
 				}
 				else
 				{