views:

220

answers:

1

I want to remove bindings in RabbitMQ without deleting the bound queue. I am using txAMQP with the 0.8 AMQP spec; it seems to be the only version that RabbitMQ supports but it has no unbind method.

Oddly enough, a perusal through the source code suggests that RabbitMQ supports unbind, which leaves me rather confused.

Can I unbind with this combination of client and server? If so, how?

+1  A: 

As you've noticed, RabbitMQ has for a few versions now supported an extension Queue.Unbind method, with definition lifted from the 0-9 specification, but not all AMQP client libraries have been extended in the same way.

To get this to work with txAMQP, you will need to take the XML definitions of the Queue.Unbind and Queue.UnbindOk methods from the 0-9 spec, paste them into the 0-8 spec file txAMQP uses, and restart your application. It should now have a Queue.Unbind method available, if I've properly understood how txAMQP works.

Here are the relevant XML stanzas, from the BSD-licensed 0-9-1 spec:

<method name="unbind" synchronous="1" index="50">
  <chassis name="server" implement="MUST"/>
  <response name="unbind-ok"/>
  <field name="reserved-1" type="short" reserved="1"/>
  <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>
Tony Garnock-Jones