queue_unbind method in txamqp

Asked by codeprophecy1@gmail.com

Hi,
Is there a way to unbind queue in txamqp ? I'm using rabbitmq broker and need to bind/unbind queues or is there some workaround available ?

Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
txAMQP Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Terry Jones (terrycojones) said :
#1

> Is there a way to unbind queue in txamqp ? I'm using rabbitmq broker and
> need to bind/unbind queues or is there some workaround available ?

The secret is to use a version of the AMQP spec that supports queue
unbinding. I.e., when you call txamqp.spec.load, pass an AMQP spec file
that knows about unbind. The 0.8 spec does not, whereas the 0.9 does.
You'll also need a version of RabbitMQ that supports it (>= 1.5.0).

I'm sure there are some more nuances here I think, but that's the gist of
it. E.g., You can play tricks, like adding the queue unbind details to the
0.8 spec file to add just that functionality.

Terry

Revision history for this message
Esteve Fernandez (esteve) said :
#2

Since txAMQP uses the XML spec files to define its methods automatically, you can hack a customized version of the spec to add support for unbind. As Terry pointed out, queue_unbind is not officially supported in the standard 0.8 version of the AMQP spec (it is, however in 0.9 and 0.9.1, OTOH 0.10 is a whole new world).

Since RabbitMQ officially supports 0.8, you can't just pass the 0.9 (or 0.9.1) spec to it, for example, the authentication mechanism change between 0.8 and 0.9. But you can pass a modified version of the spec, this is the relevant part (add it after the method definition for bind-ok):

<method name="unbind" synchronous="1" index="50">
      <chassis name="server" implement="MUST"/>
      <response name="unbind-ok"/>
      <field name="ticket" domain="access ticket"/>
      <field name="queue" domain="queue name"/>
      <field name="exchange" domain="exchange name"/>
      <field name="routing key" domain="shortstr"/>
      <field name="arguments" domain="table"/>
    </method>
    <method name="unbind-ok" synchronous="1" index="51">
      <chassis name="client" implement="MUST"/>
    </method>

Revision history for this message
Esteve Fernandez (esteve) said :
#3

I linked this question to a bug, which points to a branch where you can find a copy of the spec. Here's the direct link for the file:

http://bazaar.launchpad.net/~esteve/txamqp/538999-queue-unbind-xml/annotate/head:/src/specs/rabbitmq/amqp0-8.stripped.rabbitmq.xml

Can you help with this problem?

Provide an answer of your own, or ask codeprophecy1@gmail.com for more information if necessary.

To post a message you must log in.