Author: chug
Date: Fri Jun 28 21:15:35 2013
New Revision: 1497926
URL: http://svn.apache.org/r1497926
Log:
QPID-4969: Headers exchange allows bindings with duplicate managementId.
Modified:
qpid/trunk/qpid/cpp/src/qpid/broker/HeadersExchange.cpp
Modified: qpid/trunk/qpid/cpp/src/qpid/broker/HeadersExchange.cpp
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/HeadersExchange.cpp?rev=1497926&r1=1497925&r2=1497926&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/HeadersExchange.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/HeadersExchange.cpp Fri Jun 28 21:15:35
2013
@@ -198,6 +198,17 @@ bool HeadersExchange::bind(Queue::shared
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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]