From 6f7e2c5e6db0db14275aae3d93cecee71c2aa208 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Fri, 9 Aug 2013 17:47:42 +0000 Subject: QPID-5060: remove exchange and durable for properties map, as they apply to topic itself rather than queue and are tracked by explicit properties (merged from r1512245) git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/0.24@1512417 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/broker/amqp/Topic.cpp | 9 ++++++++- qpid/cpp/src/tests/qpidt | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/qpid/cpp/src/qpid/broker/amqp/Topic.cpp b/qpid/cpp/src/qpid/broker/amqp/Topic.cpp index 77561d1111..4bb581628b 100644 --- a/qpid/cpp/src/qpid/broker/amqp/Topic.cpp +++ b/qpid/cpp/src/qpid/broker/amqp/Topic.cpp @@ -47,6 +47,13 @@ bool testProperty(const std::string& k, const qpid::types::Variant::Map& m) else return i->second; } +qpid::types::Variant::Map filter(const qpid::types::Variant::Map& properties) +{ + qpid::types::Variant::Map filtered = properties; + filtered.erase(DURABLE); + filtered.erase(EXCHANGE); + return filtered; +} } Topic::Topic(Broker& broker, const std::string& n, const qpid::types::Variant::Map& properties) @@ -60,7 +67,7 @@ Topic::Topic(Broker& broker, const std::string& n, const qpid::types::Variant::M qpid::management::ManagementAgent* agent = broker.getManagementAgent(); if (agent != 0) { topic = _qmf::Topic::shared_ptr(new _qmf::Topic(agent, this, name, exchange->GetManagementObject()->getObjectId(), durable)); - topic->set_properties(policy.asMap()); + topic->set_properties(filter(properties)); agent->addObject(topic); } } diff --git a/qpid/cpp/src/tests/qpidt b/qpid/cpp/src/tests/qpidt index 5bdfb6eefd..92df9efc8d 100755 --- a/qpid/cpp/src/tests/qpidt +++ b/qpid/cpp/src/tests/qpidt @@ -117,7 +117,7 @@ class Manager: if k == "name": name = v elif v: - if isinstance(v, dict) and v["_object_name"]: + if isinstance(v, dict) and "_object_name" in v: v = v["_object_name"] details += "%s=%s " %(k,v) print "%-25s %s" % (name, details) -- cgit v1.2.1