activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r883509 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.2.x/src/main/csharp/MessageConsumer.cs
Date Mon, 23 Nov 2009 21:49:00 GMT
Author: tabish
Date: Mon Nov 23 21:49:00 2009
New Revision: 883509

URL: http://svn.apache.org/viewvc?rev=883509&view=rev
Log:
Merged from trunk

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/branches/1.2.x/src/main/csharp/MessageConsumer.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.2.x/src/main/csharp/MessageConsumer.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.2.x/src/main/csharp/MessageConsumer.cs?rev=883509&r1=883508&r2=883509&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.2.x/src/main/csharp/MessageConsumer.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.2.x/src/main/csharp/MessageConsumer.cs
Mon Nov 23 21:49:00 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
 				{



Mime
View raw message