diff --git a/activemq-core/src/main/java/org/apache/activemq/store/kahadb/KahaDBStore.java b/activemq-core/src/main/java/org/apache/activemq/store/kahadb/KahaDBStore.java index a67c1d82f3..6d7a41c58c 100644 --- a/activemq-core/src/main/java/org/apache/activemq/store/kahadb/KahaDBStore.java +++ b/activemq-core/src/main/java/org/apache/activemq/store/kahadb/KahaDBStore.java @@ -784,6 +784,10 @@ public class KahaDBStore extends MessageDatabase implements PersistenceAdapter { MessageOrderCursor moc = sd.subscriptionCursors.get(subscriptionKey); if (moc == null) { LastAck pos = sd.subscriptionAcks.get(tx, subscriptionKey); + if (pos == null) { + // sub deleted + return; + } sd.orderIndex.setBatch(tx, pos); moc = sd.orderIndex.cursor; } else { diff --git a/activemq-core/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java b/activemq-core/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java index dbdc0c8ab9..87e94cbe7d 100644 --- a/activemq-core/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java +++ b/activemq-core/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java @@ -1314,7 +1314,7 @@ public class MessageDatabase extends ServiceSupport implements BrokerServiceAwar public LastAck(long ackLocation) { this.lastAckedSequence = ackLocation; - this.priority = MessageOrderIndex.HI; + this.priority = MessageOrderIndex.LO; } public LastAck(long ackLocation, byte priority) { @@ -2207,7 +2207,7 @@ public class MessageDatabase extends ServiceSupport implements BrokerServiceAwar result = lowPriorityIndex.get(tx, key); lastGetPriority = LO; } else { - lastGetPriority = HI; + lastGetPriority = HI; } } else { lastGetPriority = DEF;