Hide Forgot
Description of problem: There is an low level api example in the following section: 4.6.6. Exclusive Bindings for Direct Exchanges The LLAPI is deprecated for mrg-m-300, so the high level api equivalent shall be provided. Version-Release number of selected component (if applicable): Messaging Programming Reference - Revision 0.0.0-9 How reproducible: n/a Steps to Reproduce: n/a Actual results: Low level api example in the documentation even if the LLAPI was deprecated Expected results: No LLAPI examples in the documentation
Are you sure about this? That same method is used here: https://qpid.apache.org/releases/qpid-0.24/cpp-broker/book/ch01s03.html If it needs to be replaced with another API method, is there a link to an example somewhere?
(In reply to Joshua Wulf from comment #1) > Are you sure about this? That same method is used here: > > https://qpid.apache.org/releases/qpid-0.24/cpp-broker/book/ch01s03.html > > If it needs to be replaced with another API method, is there a link to an > example somewhere? Yes, I'm pretty sure about that. The examples from the link above uses qpid::client api which was deprecated in Vienna (see bug 1008565 for details). I would expect that exclusive-binding on exchange may be defined the following way: 1. create direct exchange and define the exclusive binding: ./drain "my-direct;{create:always, node: {type:topic, x-declare:{type: direct, arguments: {qpid.exclusive-binding:True}}}}" 2. create a subscription, bind to the exchange using 'routing-key' ./drain -f "q1;{create:always, node: {x-bindings:[{'exchange': my-direct, key: routing-key }]}}" 3. create another subscription, bind to the exchange using exactly the same 'routing-key' $cppapi/drain -f "q2;{create:always, node: {x-bindings:[{'exchange': my-direct, key: routing-key }]}}" I was expecting that the second bind shall be rejected, but it's NOT, both binding were created: # qpid-config -r exchanges Exchange 'my-direct' (direct) bind [routing-key] => q1 bind [routing-key] => q2 Thus I'm wondering if that functionality is still supported at all? Also, I'm wondering how a similar case may be done using amqp1.0, because of the missing support for node scoped x-bindings. Please recheck with developers.
Gordon, are you able to provide some insight on this?
The qpid.exclusive-binding arguments shold be provided on the binding (not when creating the exchange). So with the messaging API an example might be e.g. drain -f "amq.direct; {create:always, link: {name:one, x-bindings:[{key:unique, arguments: {qpid.exclusive-binding:True}}]}}" at which point qpid-config exchange -r shows: $ qpid-config exchanges -r Exchange '' (direct) bind [39770289-1a20-4bcd-9011-670a9a9e93c3:0.0] => 39770289-1a20-4bcd-9011-670a9a9e93c3:0.0 bind [one] => one Exchange 'amq.direct' (direct) bind [unique] => one {u'qpid.exclusive-binding': True} Exchange 'amq.fanout' (fanout) Exchange 'amq.match' (headers) Exchange 'amq.topic' (topic) Exchange 'my-direct' (direct) Exchange 'qmf.default.direct' (direct) Exchange 'qmf.default.topic' (topic) bind [direct.3cdb2983-6dd3-4ba4-98fe-c55dce6c0b8d] => 39770289-1a20-4bcd-9011-670a9a9e93c3:0.0 Exchange 'qpid.management' (topic) and then in another terminal: drain -f "amq.direct; {create:always, link: {name:two, x-bindings:[{key:unique, arguments: {qpid.exclusive-binding:True}}]}}" after which qpid-config exchange -r now shows: $ qpid-config exchanges -r Exchange '' (direct) bind [9e5641a4-e758-4f56-a7c6-861628494068:0.0] => 9e5641a4-e758-4f56-a7c6-861628494068:0.0 bind [one] => one bind [two] => two Exchange 'amq.direct' (direct) bind [unique] => two {u'qpid.exclusive-binding': True} Exchange 'amq.fanout' (fanout) Exchange 'amq.match' (headers) Exchange 'amq.topic' (topic) Exchange 'my-direct' (direct) Exchange 'qmf.default.direct' (direct) Exchange 'qmf.default.topic' (topic) bind [direct.789b5f64-125c-4f1f-ad38-e1952150fb73] => 9e5641a4-e758-4f56-a7c6-861628494068:0.0 Exchange 'qpid.management' (topic) I.e. a single binding to amq.direct for that key is enforced (and now maps to the second queue, named 'two'). If you now send a message to amq.direct/unique, only the second binding will get it. This feature is not at present accessible over AMQP 1.0.
Example updated for MRG 3: http://deathstar1.usersys.redhat.com:3000/builds/19948-Messaging_Programming_Reference/#Exclusive_Bindings_for_Direct_Exchanges