Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 42268 invoked from network); 25 Sep 2009 21:45:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Sep 2009 21:45:55 -0000 Received: (qmail 10324 invoked by uid 500); 25 Sep 2009 21:45:55 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 10268 invoked by uid 500); 25 Sep 2009 21:45: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 10259 invoked by uid 99); 25 Sep 2009 21:45:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Sep 2009 21:45:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED 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; Fri, 25 Sep 2009 21:45:44 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 73C0D23888D2; Fri, 25 Sep 2009 21:45:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r819035 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSubscription.java Date: Fri, 25 Sep 2009 21:45:23 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090925214523.73C0D23888D2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Fri Sep 25 21:45:23 2009 New Revision: 819035 URL: http://svn.apache.org/viewvc?rev=819035&view=rev Log: Apply fix for: https://issues.apache.org/activemq/browse/AMQ-2426 Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSubscription.java Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSubscription.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSubscription.java?rev=819035&r1=819034&r2=819035&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSubscription.java (original) +++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSubscription.java Fri Sep 25 21:45:23 2009 @@ -35,7 +35,7 @@ /** * Keeps track of the STOMP subscription so that acking is correctly done. - * + * * @author chirino */ public class StompSubscription { @@ -54,7 +54,7 @@ private String ackMode = AUTO_ACK; private ActiveMQDestination destination; private String transformation; - + public StompSubscription(ProtocolConverter stompTransport, String subscriptionId, ConsumerInfo consumerInfo, String transformation) { this.protocolConverter = stompTransport; @@ -79,7 +79,7 @@ } boolean ignoreTransformation = false; - + if (transformation != null) { message.setReadOnlyProperties(false); message.setStringProperty(Stomp.Headers.TRANSFORMATION, transformation); @@ -88,21 +88,21 @@ ignoreTransformation = true; } } - + StompFrame command = protocolConverter.convertMessage(message, ignoreTransformation); command.setAction(Stomp.Responses.MESSAGE); if (subscriptionId != null) { command.getHeaders().put(Stomp.Headers.Message.SUBSCRIPTION, subscriptionId); } - + protocolConverter.getTransportFilter().sendToStomp(command); } - + synchronized void onStompAbort(TransactionId transactionId) { unconsumedMessage.clear(); } - + synchronized void onStompCommit(TransactionId transactionId) { for (Iterator iter = dispatchedMessage.entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Entry)iter.next(); @@ -116,9 +116,9 @@ } synchronized MessageAck onStompMessageAck(String messageId, TransactionId transactionId) { - + MessageId msgId = new MessageId(messageId); - + if (!dispatchedMessage.containsKey(msgId)) { return null; } @@ -139,7 +139,7 @@ if (ack.getFirstMessageId() == null) { ack.setFirstMessageId(id); } - + if (transactionId != null) { if (!unconsumedMessage.contains(msg)) { unconsumedMessage.add(msg); @@ -147,8 +147,8 @@ } else { iter.remove(); } - - + + count++; if (id.equals(msgId)) { @@ -168,8 +168,8 @@ if (transactionId != null) { unconsumedMessage.add(dispatchedMessage.get(msgId)); ack.setTransactionId(transactionId); - } - dispatchedMessage.remove(messageId); + } + dispatchedMessage.remove(msgId); } return ack; }