Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 15179 invoked from network); 23 Nov 2009 19:54:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Nov 2009 19:54:56 -0000 Received: (qmail 83049 invoked by uid 500); 23 Nov 2009 19:54:56 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 82991 invoked by uid 500); 23 Nov 2009 19:54:55 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 82982 invoked by uid 99); 23 Nov 2009 19:54:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Nov 2009 19:54:55 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Nov 2009 19:54:53 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5606D23888E8; Mon, 23 Nov 2009 19:54:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r883475 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs Date: Mon, 23 Nov 2009 19:54:27 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091123195433.5606D23888E8@eris.apache.org> 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 {