activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r613832 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQTopicMessageStore.java
Date Mon, 21 Jan 2008 10:33:57 GMT
Author: rajdavies
Date: Mon Jan 21 02:33:55 2008
New Revision: 613832

URL: http://svn.apache.org/viewvc?rev=613832&view=rev
Log:
Fix for https://issues.apache.org/activemq/browse/AMQ-1559

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQTopicMessageStore.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQTopicMessageStore.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQTopicMessageStore.java?rev=613832&r1=613831&r2=613832&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQTopicMessageStore.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQTopicMessageStore.java
Mon Jan 21 02:33:55 2008
@@ -145,16 +145,21 @@
      * @param key
      * @throws IOException 
      */
-    protected void acknowledge(ConnectionContext context, MessageId messageId,
+    protected void acknowledge(final ConnectionContext context, MessageId messageId,
             Location location, String clientId, String subscriptionName)
             throws IOException {
+        MessageAck ack = null;
         synchronized (this) {
             lastLocation = location;
+        
+            if (topicReferenceStore.acknowledgeReference(context, clientId,
+                    subscriptionName, messageId)) {
+                ack = new MessageAck();
+                ack.setLastMessageId(messageId);
+               
+            }
         }
-        if (topicReferenceStore.acknowledgeReference(context, clientId,
-                subscriptionName, messageId)) {
-            MessageAck ack = new MessageAck();
-            ack.setLastMessageId(messageId);
+        if (ack != null) {
             removeMessage(context, ack);
         }
     }



Mime
View raw message