Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B4172934A for ; Tue, 11 Oct 2011 13:13:33 +0000 (UTC) Received: (qmail 51385 invoked by uid 500); 11 Oct 2011 13:13:33 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 51355 invoked by uid 500); 11 Oct 2011 13:13:33 -0000 Mailing-List: contact dev-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 dev@activemq.apache.org Received: (qmail 51347 invoked by uid 99); 11 Oct 2011 13:13:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Oct 2011 13:13:33 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Oct 2011 13:13:32 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id C4F5736DF7 for ; Tue, 11 Oct 2011 13:13:11 +0000 (UTC) Date: Tue, 11 Oct 2011 13:13:11 +0000 (UTC) From: "Martin Serrano (Updated) (JIRA)" To: dev@activemq.apache.org Message-ID: <1041114671.612.1318338791808.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1107075314.493.1318336871967.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (AMQ-3535) ActiveMQMessageConsumer auto ack of duplicates always sends a standard ack MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMQ-3535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martin Serrano updated AMQ-3535: -------------------------------- Description: When the ActiveMQMessageConsumer auto acks a duplicate, it always sends a standard ack. This occurs even when the session was opened in individual acknowledge mode. This results in the acknowledgments usually generating the "unmatched ack" message, causing the ack to be dropped. Since this is a duplicate, generally things are okay, but the spurious error message is troubling and the inflight and dequeue counts will be wrong from then on. I have also noticed that there are several places in ActiveMQMessageConsumer that allow potential creation of acks that do not coincide with the session settings. Perhaps ActiveMQSession.sendAck should throw IllegalArgumentException if the ack type does not match the session? was: When the ActiveMQMessageConsumer auto acks a duplicate, it always sends a standard ack. This occurs even when the session was opened in individual acknowledge mode. This results in the acknowledgments usually generating the "unmatched ack" message, causing the ack to be dropped. Since this is a duplicate, generally things are okay, but the spurious error message is troubling and the inflight and dequeue counts will be wrong from then on. The following patch fixes the issue: {code:java} Index: src/org/apache/activemq/ActiveMQMessageConsumer.java =================================================================== --- src/org/apache/activemq/ActiveMQMessageConsumer.java (revision 46059) +++ src/org/apache/activemq/ActiveMQMessageConsumer.java (working copy) @@ -1257,7 +1257,8 @@ if (LOG.isDebugEnabled()) { LOG.debug(getConsumerId() + " ignoring (auto acking) duplicate: " + md.getMessage()); } - MessageAck ack = new MessageAck(md, MessageAck.STANDARD_ACK_TYPE, 1); + + MessageAck ack = new MessageAck(md, (byte) session.acknowledgementMode, 1); session.sendAck(ack); } else { if (LOG.isDebugEnabled()) { {code} I have also noticed that there are several places in ActiveMQMessageConsumer that allow potential creation of acks that do not coincide with the session settings. Perhaps ActiveMQSession.sendAck should throw IllegalArgumentException if the ack type does not match the session? Patch Info: (was: Patch Available) removing (incomplete) patch that was in description > ActiveMQMessageConsumer auto ack of duplicates always sends a standard ack > -------------------------------------------------------------------------- > > Key: AMQ-3535 > URL: https://issues.apache.org/jira/browse/AMQ-3535 > Project: ActiveMQ > Issue Type: Bug > Components: JMS client > Affects Versions: 5.5.0 > Reporter: Martin Serrano > Priority: Critical > > When the ActiveMQMessageConsumer auto acks a duplicate, it always sends a standard ack. This occurs even when the session was opened in individual acknowledge mode. This results in the acknowledgments usually generating the "unmatched ack" message, causing the ack to be dropped. Since this is a duplicate, generally things are okay, but the spurious error message is troubling and the inflight and dequeue counts will be wrong from then on. > I have also noticed that there are several places in ActiveMQMessageConsumer that allow potential creation of acks that do not coincide with the session settings. Perhaps ActiveMQSession.sendAck should throw IllegalArgumentException if the ack type does not match the session? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira