Revert "AMQ-6947 - Update Queue metrics on expiration"

This reverts commit bca0af4133.
This commit is contained in:
Christopher L. Shannon (cshannon) 2018-04-18 12:35:01 -04:00
parent bca0af4133
commit 86fbf957e9
1 changed files with 2 additions and 11 deletions

View File

@ -1842,7 +1842,8 @@ public class Queue extends BaseDestination implements Task, UsageListener, Index
pagedInMessagesLock.writeLock().lock();
try {
if (pagedInMessages.remove(reference) != null) {
updateMetricsOnMessageDrop();
getDestinationStatistics().getDequeues().increment();
getDestinationStatistics().getMessages().decrement();
}
} finally {
pagedInMessagesLock.writeLock().unlock();
@ -1850,11 +1851,6 @@ public class Queue extends BaseDestination implements Task, UsageListener, Index
}
}
private void updateMetricsOnMessageDrop() {
getDestinationStatistics().getDequeues().increment();
getDestinationStatistics().getMessages().decrement();
}
public void messageExpired(ConnectionContext context, MessageReference reference) {
messageExpired(context, null, reference);
}
@ -2011,11 +2007,6 @@ public class Queue extends BaseDestination implements Task, UsageListener, Index
if (processExpired && ref.isExpired()) {
if (broker.isExpired(ref)) {
messageExpired(createConnectionContext(), ref);
//We need to update the metrics here because the drop message
//method will only update if the message was removed from the
//pagedInMessages list which won't happen in this case
updateMetricsOnMessageDrop();
} else {
ref.decrementReferenceCount();
}