diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2010-06-03 21:28:41 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2010-06-03 21:28:41 +0000 |
| commit | d661a591cda7dbd6b4bb7332aad235924714eb7f (patch) | |
| tree | ab18bfffe717ead9324d0d08339c549de561acbc /java/broker-plugins | |
| parent | 07963cbeb3c77bab551b03071d9db65896d0e143 (diff) | |
| download | qpid-python-d661a591cda7dbd6b4bb7332aad235924714eb7f.tar.gz | |
QPID-1447 : Update SCD for MessageAge when queue is empty at consumer connect. Perhaps additional test requried where queue has old messages but no delete policy, just disconnect. Consumer will be disconnected during the first receive(). Also why is the oldest Arrival time set to Long.MAX_LONG when there are no messages on the queue, why not 0.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@951162 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/broker-plugins')
| -rw-r--r-- | java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/SlowConsumerDetection.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/SlowConsumerDetection.java b/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/SlowConsumerDetection.java index 73ba91f1e8..71071d4d90 100644 --- a/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/SlowConsumerDetection.java +++ b/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/SlowConsumerDetection.java @@ -117,9 +117,18 @@ class SlowConsumerDetection extends VirtualHostHouseKeepingPlugin if (config != null) { _logger.info("Retrieved Queue(" + q.getName() + ") Config:" + config); - if ((config.getMessageCount() != 0 && q.getMessageCount() >= config.getMessageCount()) || - (config.getDepth() != 0 && q.getQueueDepth() >= config.getDepth()) || - (config.getMessageAge() != 0 && q.getOldestMessageArrivalTime() >= config.getMessageAge())) + + int count = q.getMessageCount(); + + // First Check message counts + if ((config.getMessageCount() != 0 && count >= config.getMessageCount()) || + // The check queue depth + (config.getDepth() != 0 && q.getQueueDepth() >= config.getDepth()) || + // finally if we have messages on the queue check Arrival time. + // We must check count as OldestArrival time is Long.MAX_LONG when + // there are no messages. + (config.getMessageAge() != 0 && + ((count > 0) && q.getOldestMessageArrivalTime() >= config.getMessageAge()))) { if (_logger.isDebugEnabled()) |
