summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/QueuePolicy.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-07-25 13:50:32 +0000
committerGordon Sim <gsim@apache.org>2008-07-25 13:50:32 +0000
commit1ce91a21e53358cfdb88203a7d00f9e99c4f5487 (patch)
treed8c3ee61c703c79e54185f22f07bc63f88302fb2 /cpp/src/qpid/broker/QueuePolicy.cpp
parentc063c7b4a350ce64abb4075b28b0de16fd5ec71c (diff)
downloadqpid-python-1ce91a21e53358cfdb88203a7d00f9e99c4f5487.tar.gz
Only reduce count and size maintained for queue plicy when messages are actually dequeued (i.e. acked).
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@679805 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/QueuePolicy.cpp')
-rw-r--r--cpp/src/qpid/broker/QueuePolicy.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/cpp/src/qpid/broker/QueuePolicy.cpp b/cpp/src/qpid/broker/QueuePolicy.cpp
index de84362f8f..08838aac79 100644
--- a/cpp/src/qpid/broker/QueuePolicy.cpp
+++ b/cpp/src/qpid/broker/QueuePolicy.cpp
@@ -71,3 +71,18 @@ const std::string QueuePolicy::maxCountKey("qpid.max_count");
const std::string QueuePolicy::maxSizeKey("qpid.max_size");
uint64_t QueuePolicy::defaultMaxSize(0);
+namespace qpid {
+ namespace broker {
+
+std::ostream& operator<<(std::ostream& out, const QueuePolicy& p)
+{
+ if (p.maxSize) out << "size: max=" << p.maxSize << ", current=" << p.size;
+ else out << "size unlimited, current=" << p.size;
+ out << "; ";
+ if (p.maxCount) out << "count: max=" << p.maxCount << ", current=" << p.count;
+ else out << "count unlimited, current=" << p.count;
+ return out;
+}
+
+ }
+}