activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject git commit: https://issues.apache.org/jira/browse/AMQ-5354 - patch applied with thanks
Date Mon, 15 Sep 2014 14:59:47 GMT
Repository: activemq
Updated Branches:
  refs/heads/trunk 8ab9a56d3 -> a0c42a61d


https://issues.apache.org/jira/browse/AMQ-5354 - patch applied with thanks


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/a0c42a61
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/a0c42a61
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/a0c42a61

Branch: refs/heads/trunk
Commit: a0c42a61dd1af5a6f0d3a65862310dd9728d4ffa
Parents: 8ab9a56
Author: gtully <gary.tully@gmail.com>
Authored: Mon Sep 15 15:59:00 2014 +0100
Committer: gtully <gary.tully@gmail.com>
Committed: Mon Sep 15 15:59:00 2014 +0100

----------------------------------------------------------------------
 .../java/org/apache/activemq/store/kahadb/MessageDatabase.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/a0c42a61/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
----------------------------------------------------------------------
diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
index 776930b..c8bc2b8 100644
--- a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
+++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
@@ -1369,13 +1369,16 @@ public abstract class MessageDatabase extends ServiceSupport implements
BrokerSe
 
         Long id = sd.messageIdIndex.get(tx, command.getMessageId());
         if (id != null) {
-            sd.orderIndex.put(
+            MessageKeys previousKeys = sd.orderIndex.put(
                     tx,
                     command.getPrioritySupported() ? command.getPriority() : javax.jms.Message.DEFAULT_PRIORITY,
                     id,
                     new MessageKeys(command.getMessageId(), location)
             );
             sd.locationIndex.put(tx, location, id);
+            if(previousKeys != null) {
+                sd.locationIndex.remove(tx, previousKeys.location);
+            }
         } else {
             LOG.warn("Non existent message update attempt rejected. Destination: {}://{},
Message id: {}", command.getDestination().getType(), command.getDestination().getName(), command.getMessageId());
         }


Mime
View raw message