https://issues.apache.org/jira/browse/AMQ-5960 - durable sub pendingQueueSize after force shutdown - fix npe test failure

This commit is contained in:
Dejan Bosanac 2015-09-10 14:12:59 +02:00
parent d1dface01a
commit f4a2543def
1 changed files with 6 additions and 4 deletions

View File

@ -1348,11 +1348,13 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe
sd.locationIndex.put(tx, location, previous); sd.locationIndex.put(tx, location, previous);
metadata.lastUpdate = location; metadata.lastUpdate = location;
// remove ack positions // remove ack positions
if (sd.subscriptions != null && !sd.subscriptions.isEmpty(tx)) {
Iterator<Entry<String, SequenceSet>> it = sd.ackPositions.iterator(tx); Iterator<Entry<String, SequenceSet>> it = sd.ackPositions.iterator(tx);
while (it.hasNext()) { while (it.hasNext()) {
Entry<String, SequenceSet> entry = it.next(); Entry<String, SequenceSet> entry = it.next();
entry.getValue().remove(id); entry.getValue().remove(id);
} }
}
} }
// record this id in any event, initial send or recovery // record this id in any event, initial send or recovery