From fcabcd282dc01c6faaff3c7627882f42a64543b4 Mon Sep 17 00:00:00 2001 From: gtully Date: Wed, 23 Sep 2015 13:15:29 +0100 Subject: [PATCH 1/4] https://issues.apache.org/jira/browse/AMQ-5960 - rework fix to reset the next sequence so that the next ack position and message reference gets cleared up in normal operation --- .../store/kahadb/MessageDatabase.java | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) 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 815b9dfe2f..351219087f 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 @@ -1319,7 +1319,7 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe // Add the message. int priority = command.getPrioritySupported() ? command.getPriority() : javax.jms.Message.DEFAULT_PRIORITY; - long id = sd.orderIndex.getNextMessageId(priority); + long id = sd.orderIndex.getNextMessageId(); Long previous = sd.locationIndex.put(tx, location, id); if (previous == null) { previous = sd.messageIdIndex.put(tx, command.getMessageId(), id); @@ -1346,16 +1346,9 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe // added message. We don't want to assign it a new id as the other indexes would // be wrong.. sd.locationIndex.put(tx, location, previous); + // ensure sequence is not broken + sd.orderIndex.revertNextMessageId(); metadata.lastUpdate = location; - // remove ack positions - if (sd.subscriptions != null && !sd.subscriptions.isEmpty(tx)) { - Iterator> it = sd.ackPositions.iterator(tx); - while (it.hasNext()) { - Entry entry = it.next(); - entry.getValue().remove(id); - } - } - } // record this id in any event, initial send or recovery metadata.producerSequenceIdTracker.isDuplicate(command.getMessageId()); @@ -1443,7 +1436,7 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe removeAckLocation(command, tx, sd, subscriptionKey, sequence); metadata.lastUpdate = ackLocation; } else if (LOG.isDebugEnabled()) { - LOG.debug("no message sequence exists for id: " + command.getMessageId() + " and sub: " + command.getSubscriptionKey()); + LOG.debug("on ack, no message sequence exists for id: " + command.getMessageId() + " and sub: " + command.getSubscriptionKey()); } } @@ -3183,10 +3176,14 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe deletes.add(iterator.next()); } - long getNextMessageId(int priority) { + long getNextMessageId() { return nextMessageId++; } + void revertNextMessageId() { + nextMessageId--; + } + MessageKeys get(Transaction tx, Long key) throws IOException { MessageKeys result = defaultPriorityIndex.get(tx, key); if (result == null) { From b68b273c4c7eb99c5a6dc1564f12f6371887c97f Mon Sep 17 00:00:00 2001 From: Chad Zobrisky Date: Wed, 23 Sep 2015 16:31:41 +0000 Subject: [PATCH 2/4] https://issues.apache.org/jira/browse/AMQ-5982 Updating netty to version 4.0.31 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d6fc6c1294..183c931405 100755 --- a/pom.xml +++ b/pom.xml @@ -103,7 +103,7 @@ 3.4.6 0.10 0.5.0 - 4.0.29.Final + 4.0.31.Final 1.3 1.0 9.5.1-2 From b2b949791a16f7c43871187cad9778ae0f92d076 Mon Sep 17 00:00:00 2001 From: Timothy Bish Date: Wed, 23 Sep 2015 13:32:25 -0400 Subject: [PATCH 3/4] https://issues.apache.org/jira/browse/AMQ-5878 Update to latest bugfix release of Jackson. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 183c931405..2c15be295f 100755 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ 4.5 4.4.3 1.2.0.Beta4 - 2.6.1 + 2.6.2 1.9.2 2.2.11_1 1.0 From caac4f784ff93de71b776cce19804907dda868ca Mon Sep 17 00:00:00 2001 From: Timothy Bish Date: Thu, 24 Sep 2015 18:44:14 -0400 Subject: [PATCH 4/4] https://issues.apache.org/jira/browse/AMQ-5962 http-client v4.5.1 now latest. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2c15be295f..40132202cc 100755 --- a/pom.xml +++ b/pom.xml @@ -68,7 +68,7 @@ 1.21 0.1.8 1.8.0.12 - 4.5 + 4.5.1 4.4.3 1.2.0.Beta4 2.6.2