summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2013-08-09 17:47:42 +0000
committerGordon Sim <gsim@apache.org>2013-08-09 17:47:42 +0000
commit6f7e2c5e6db0db14275aae3d93cecee71c2aa208 (patch)
tree51e65352c81c83be84bee4329c3dcce63f0dc9c0
parent3fe57bb889c79a5035246ec3a8b7359df9f124c1 (diff)
downloadqpid-python-6f7e2c5e6db0db14275aae3d93cecee71c2aa208.tar.gz
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
-rw-r--r--qpid/cpp/src/qpid/broker/amqp/Topic.cpp9
-rwxr-xr-xqpid/cpp/src/tests/qpidt2
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)