From d43d1912b376322e27fdcda551a73f9ff5487972 Mon Sep 17 00:00:00 2001 From: Kim van der Riet Date: Fri, 3 Aug 2012 12:13:32 +0000 Subject: QPID-3858: Updated branch - merged from trunk r.1368650 git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1368910 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/cluster/UpdateClient.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'cpp/src/qpid/cluster/UpdateClient.cpp') diff --git a/cpp/src/qpid/cluster/UpdateClient.cpp b/cpp/src/qpid/cluster/UpdateClient.cpp index 20684fd8a7..8737418570 100644 --- a/cpp/src/qpid/cluster/UpdateClient.cpp +++ b/cpp/src/qpid/cluster/UpdateClient.cpp @@ -74,6 +74,8 @@ namespace qpid { namespace cluster { +using std::string; + using amqp_0_10::ListCodec; using broker::Broker; using broker::Exchange; @@ -87,6 +89,8 @@ using namespace framing; namespace arg=client::arg; using client::SessionBase_0_10Access; +namespace _qmf = qmf::org::apache::qpid::broker; + // Reserved exchange/queue name for catch-up, avoid clashes with user queues/exchanges. const std::string UpdateClient::UPDATE("x-qpid.cluster-update"); // Name for header used to carry expiration information. @@ -226,14 +230,6 @@ template std::string encode(const T& t) { t.encode(buf); return encoded; } - -template std::string encode(const T& t, bool encodeKind) { - std::string encoded; - encoded.resize(t.encodedSize()); - framing::Buffer buf(const_cast(encoded.data()), encoded.size()); - t.encode(buf, encodeKind); - return encoded; -} } // namespace @@ -377,13 +373,14 @@ class MessageUpdater { void UpdateClient::updateQueue(client::AsyncSession& s, const boost::shared_ptr& q) { broker::Exchange::shared_ptr alternateExchange = q->getAlternateExchange(); + _qmf::Queue* mgmtQueue = dynamic_cast<_qmf::Queue*>(q->GetManagementObject()); s.queueDeclare( arg::queue = q->getName(), arg::durable = q->isDurable(), arg::autoDelete = q->isAutoDelete(), arg::alternateExchange = alternateExchange ? alternateExchange->getName() : "", arg::arguments = q->getSettings(), - arg::exclusive = q->hasExclusiveOwner() + arg::exclusive = mgmtQueue && mgmtQueue->get_exclusive() ); MessageUpdater updater(q->getName(), s, expiry); q->eachMessage(boost::bind(&MessageUpdater::updateQueuedMessage, &updater, _1)); @@ -545,7 +542,8 @@ void UpdateClient::updateConsumer( ci->isNotifyEnabled(), ci->getPosition(), ci->getCredit().used().messages, - ci->getCredit().used().bytes + ci->getCredit().used().bytes, + ci->getDeliveryCount() ); consumerNumbering.add(ci.get()); -- cgit v1.2.1