qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r941306 - in /qpid/trunk/qpid: cpp/examples/messaging/spout.cpp cpp/src/qpid/client/amqp0_10/AddressResolution.cpp doc/book/src/Programming-In-Apache-Qpid.xml
Date Wed, 05 May 2010 14:22:26 GMT
Author: gsim
Date: Wed May  5 14:22:25 2010
New Revision: 941306

URL: http://svn.apache.org/viewvc?rev=941306&view=rev
Log:
Allow empty subject for direct- and xml- exchanges

Modified:
    qpid/trunk/qpid/cpp/examples/messaging/spout.cpp
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp
    qpid/trunk/qpid/doc/book/src/Programming-In-Apache-Qpid.xml

Modified: qpid/trunk/qpid/cpp/examples/messaging/spout.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/examples/messaging/spout.cpp?rev=941306&r1=941305&r2=941306&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/examples/messaging/spout.cpp (original)
+++ qpid/trunk/qpid/cpp/examples/messaging/spout.cpp Wed May  5 14:22:25 2010
@@ -160,7 +160,6 @@ int main(int argc, char** argv)
                 spoutid << id << ":" << count;
                 message.getProperties()["spout-id"] = spoutid.str();
                 sender.send(message);
-                std::cout << "Sent " << (count+1) << " of " << options.count
<< " messages" <<std::endl; 
             }
             connection.close();
             return 0;

Modified: qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp?rev=941306&r1=941305&r2=941306&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/AddressResolution.cpp Wed May  5 14:22:25
2010
@@ -127,7 +127,7 @@ const std::string FANOUT_EXCHANGE("fanou
 const std::string DIRECT_EXCHANGE("direct");
 const std::string HEADERS_EXCHANGE("headers");
 const std::string XML_EXCHANGE("xml");
-const std::string WILDCARD_ANY("*");
+const std::string WILDCARD_ANY("#");
 
 const Verifier verifier;
 }
@@ -529,8 +529,12 @@ void Subscription::bindAll()
         Binding b(name, queue, "match-all");
         b.arguments.setString("x-match", "all");
         bindings.push_back(b);
-    } else { //E.g. direct and xml
-        throw ResolutionError(QPID_MSG("Cannot create binding to match all messages for exchange
of type " << actualType));
+    } else if (actualType == XML_EXCHANGE) {
+        Binding b(name, queue, EMPTY_STRING);
+        b.arguments.setString("xquery", "true()");
+        bindings.push_back(b);
+    } else { 
+        add(name, EMPTY_STRING);
     }
 }
 

Modified: qpid/trunk/qpid/doc/book/src/Programming-In-Apache-Qpid.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/doc/book/src/Programming-In-Apache-Qpid.xml?rev=941306&r1=941305&r2=941306&view=diff
==============================================================================
--- qpid/trunk/qpid/doc/book/src/Programming-In-Apache-Qpid.xml (original)
+++ qpid/trunk/qpid/doc/book/src/Programming-In-Apache-Qpid.xml Wed May  5 14:22:25 2010
@@ -1703,13 +1703,9 @@ else 
         </listitem>
         <listitem>
           <para>
-            A source address that resolves to a direct exchange must
-            either contain a subject or must include a value for the
-            x-bindings option in the link properties. This is because
-            there is no way to receive all messages sent to an
-            exchange of that type. The subject specified is used as
-            the binding key (this means it must match the message
-            subject exactly).
+            For a direct exchange, the subject is used as the binding
+            key. If no subject is specified an empty string is used as
+            the binding key.
           </para>
         </listitem>
         <listitem>
@@ -1735,12 +1731,15 @@ else 
             matches any message with that value for
             qpid.subject. Again this means that only messages whose
             subject exactly match that specified in the source address
-            are received. For more control the x-bindings element in
-            the link properties must be used. A source address that
-            resolves to the XML exchange must contain either a subject
-            or an x-bindings element in the link properties as there
-            is no way at present to receive any message regardless of
-            routing key.
+            are received. If no subject is specified then the empty
+            string is used as the binding key with an xquery that will
+            match any message (this means that only messages with an
+            empty string as the routing key will be received). For more
+            control the x-bindings element in the link properties must
+            be used. A source address that resolves to the XML
+            exchange must contain either a subject or an x-bindings
+            element in the link properties as there is no way at
+            present to receive any message regardless of routing key.
           </para>
         </listitem>
       </itemizedlist>



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message