Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to clear a queue routingkey binding in rabbitmq (.net)

How can I clear all routing key binding from a queue in rabbitmq?

The QueueUnbind method need the routingkey parameter, but I just want to clear all bindings.

like image 523
Hourglass Avatar asked Dec 28 '25 18:12

Hourglass


1 Answers

AMQP does not allow you to do this. According to this discussion, you can workaround this by having an intermediate exchange.

Basically, you create a fanout exchange which connects directly to the exchange you are interested in. You have clients which binds queues to this intermediate exchange. When you decide you want to clear all the queues, you can simply destroy this intermediate exchange.

like image 167
Lawliet Avatar answered Dec 31 '25 08:12

Lawliet



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!