Revert "AMQ-6947 - Make sure counters are updated correct on message drop"

This reverts commit 1fe096cb2a.
This commit is contained in:
Christopher L. Shannon (cshannon) 2018-04-18 12:35:10 -04:00
parent 86fbf957e9
commit 79fae8c00b
1 changed files with 3 additions and 4 deletions

View File

@ -1839,12 +1839,11 @@ public class Queue extends BaseDestination implements Task, UsageListener, Index
private void dropMessage(QueueMessageReference reference) { private void dropMessage(QueueMessageReference reference) {
//use dropIfLive so we only process the statistics at most one time //use dropIfLive so we only process the statistics at most one time
if (reference.dropIfLive()) { if (reference.dropIfLive()) {
getDestinationStatistics().getDequeues().increment();
getDestinationStatistics().getMessages().decrement();
pagedInMessagesLock.writeLock().lock(); pagedInMessagesLock.writeLock().lock();
try { try {
if (pagedInMessages.remove(reference) != null) { pagedInMessages.remove(reference);
getDestinationStatistics().getDequeues().increment();
getDestinationStatistics().getMessages().decrement();
}
} finally { } finally {
pagedInMessagesLock.writeLock().unlock(); pagedInMessagesLock.writeLock().unlock();
} }