qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r731710 - /qpid/trunk/qpid/cpp/src/qpid/broker/DirectExchange.cpp
Date Mon, 05 Jan 2009 20:51:41 GMT
Author: gsim
Date: Mon Jan  5 12:51:41 2009
New Revision: 731710

URL: http://svn.apache.org/viewvc?rev=731710&view=rev
Log:
Reduce log level from warning to info as (a) its not necessarily a bad thing at all and (b)
the default logging level is now at notice+


Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/DirectExchange.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/DirectExchange.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/DirectExchange.cpp?rev=731710&r1=731709&r2=731710&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/DirectExchange.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/DirectExchange.cpp Mon Jan  5 12:51:41 2009
@@ -33,6 +33,7 @@
 const std::string qpidFedOp("qpid.fed.op");
 const std::string qpidFedTags("qpid.fed.tags");
 const std::string qpidFedOrigin("qpid.fed.origin");
+const std::string qpidExclusiveBinding("qpid.exclusive-binding");
 
 const std::string fedOpBind("B");
 const std::string fedOpUnbind("U");
@@ -56,15 +57,25 @@
 
 bool DirectExchange::bind(Queue::shared_ptr queue, const string& routingKey, const FieldTable*
args)
 {
-    string fedOp(args ? args->getAsString(qpidFedOp) : fedOpBind);
-    string fedTags(args ? args->getAsString(qpidFedTags) : "");
-    string fedOrigin(args ? args->getAsString(qpidFedOrigin) : "");
+    string fedOp(fedOpBind);
+    string fedTags;
+    string fedOrigin;
+    bool exclusiveBinding = false;
+    if (args) {
+        fedOp = args->getAsString(qpidFedOp);
+        fedTags = args->getAsString(qpidFedTags);
+        fedOrigin = args->getAsString(qpidFedOrigin);
+        exclusiveBinding = args->get(qpidExclusiveBinding);
+    }
+
     bool propagate = false;
 
     if (args == 0 || fedOp.empty() || fedOp == fedOpBind) {
         Mutex::ScopedLock l(lock);
         Binding::shared_ptr b(new Binding(routingKey, queue, this, FieldTable(), fedOrigin));
         BoundKey& bk = bindings[routingKey];
+        if (exclusiveBinding) bk.queues.clear();
+
         if (bk.queues.add_unless(b, MatchQueue(queue))) {
             propagate = bk.fedBinding.addOrigin(fedOrigin);
             if (mgmtExchange != 0) {
@@ -138,7 +149,8 @@
     }
 
     if(!count){
-        QPID_LOG(warning, "DirectExchange " << getName() << " could not route
message with key " << routingKey);
+        QPID_LOG(info, "DirectExchange " << getName() << " could not route message
with key " << routingKey
+                 << "; no matching binding found");
         if (mgmtExchange != 0) {
             mgmtExchange->inc_msgDrops();
             mgmtExchange->inc_byteDrops(msg.contentSize());



Mime
View raw message