mirror of https://github.com/apache/activemq.git
Revert "AMQ-6947 - Update Queue metrics on expiration"
This reverts commit bca0af4133
.
This commit is contained in:
parent
bca0af4133
commit
86fbf957e9
|
@ -1842,7 +1842,8 @@ public class Queue extends BaseDestination implements Task, UsageListener, Index
|
||||||
pagedInMessagesLock.writeLock().lock();
|
pagedInMessagesLock.writeLock().lock();
|
||||||
try {
|
try {
|
||||||
if (pagedInMessages.remove(reference) != null) {
|
if (pagedInMessages.remove(reference) != null) {
|
||||||
updateMetricsOnMessageDrop();
|
getDestinationStatistics().getDequeues().increment();
|
||||||
|
getDestinationStatistics().getMessages().decrement();
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
pagedInMessagesLock.writeLock().unlock();
|
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) {
|
public void messageExpired(ConnectionContext context, MessageReference reference) {
|
||||||
messageExpired(context, null, reference);
|
messageExpired(context, null, reference);
|
||||||
}
|
}
|
||||||
|
@ -2011,11 +2007,6 @@ public class Queue extends BaseDestination implements Task, UsageListener, Index
|
||||||
if (processExpired && ref.isExpired()) {
|
if (processExpired && ref.isExpired()) {
|
||||||
if (broker.isExpired(ref)) {
|
if (broker.isExpired(ref)) {
|
||||||
messageExpired(createConnectionContext(), 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 {
|
} else {
|
||||||
ref.decrementReferenceCount();
|
ref.decrementReferenceCount();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue