https://issues.apache.org/jira/browse/AMQ-6014 - topic store prefetch should take ownership like in the non persistent case - DurableSubscriberNonPersistentMessageTest regression

This commit is contained in:
gtully 2015-11-23 12:26:26 +00:00
parent 48fbd3116d
commit 4318eba4a3
2 changed files with 1 additions and 3 deletions

View File

@ -228,9 +228,6 @@ public class DurableTopicSubscription extends PrefetchSubscription implements Us
if (keepDurableSubsActive && pending.isTransient()) { if (keepDurableSubsActive && pending.isTransient()) {
pending.addMessageFirst(node); pending.addMessageFirst(node);
pending.rollback(node.getMessageId()); pending.rollback(node.getMessageId());
// not sure why pending.addMessageFirst does not take ownership of message reference
// by incrementing
node.incrementReferenceCount();
} }
// createMessageDispatch increments on remove from pending for dispatch // createMessageDispatch increments on remove from pending for dispatch
node.decrementReferenceCount(); node.decrementReferenceCount();

View File

@ -69,6 +69,7 @@ class TopicStorePrefetch extends AbstractStoreCursor {
public synchronized void addMessageFirst(MessageReference node) throws Exception { public synchronized void addMessageFirst(MessageReference node) throws Exception {
batchList.addMessageFirst(node); batchList.addMessageFirst(node);
size++; size++;
node.incrementReferenceCount();
//this.messageSize.addSize(node.getMessage().getSize()); //this.messageSize.addSize(node.getMessage().getSize());
} }