summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorCharles E. Rolke <chug@apache.org>2013-06-28 21:15:35 +0000
committerCharles E. Rolke <chug@apache.org>2013-06-28 21:15:35 +0000
commit77ca52cabbbe8f5083b1ac9eb02f18c43c84c033 (patch)
tree8e42b9341cc5291b53facf3ab345bff122467c85 /cpp
parentbcda338dece810041bca3c7260f2a2301b18f8ae (diff)
downloadqpid-python-77ca52cabbbe8f5083b1ac9eb02f18c43c84c033.tar.gz
QPID-4969: Headers exchange allows bindings with duplicate managementId.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1497926 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/qpid/broker/HeadersExchange.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/cpp/src/qpid/broker/HeadersExchange.cpp b/cpp/src/qpid/broker/HeadersExchange.cpp
index 611978beef..204f5cf676 100644
--- a/cpp/src/qpid/broker/HeadersExchange.cpp
+++ b/cpp/src/qpid/broker/HeadersExchange.cpp
@@ -198,6 +198,17 @@ bool HeadersExchange::bind(Queue::shared_ptr queue, const string& bindingKey, co
throw InternalErrorException(QPID_MSG("Invalid or missing x-match value binding to headers exchange. Must be a string [\"all\" or \"any\"]"));
}
+ Bindings::ConstPtr p = bindings.snapshot();
+ if (p.get()) {
+ for (std::vector<BoundKey>::const_iterator i = p->begin(); i != p->end(); ++i) {
+ if (queue == i->binding->queue && bindingKey == i->binding->key) {
+ throw InternalErrorException(QPID_MSG("Exchange: " << getName()
+ << ", binding key: " << bindingKey
+ << " Duplicate binding key not allowed." ));
+ }
+ }
+ }
+
{
Mutex::ScopedLock l(lock);
//NOTE: do not include the fed op/tags/origin in the