How to remove queue binding from RabbitMQ?

I use RabbitMQ to send messages to interested parties on topics. Each subscriber has a queue, and I tie the queue to those that they are interested in. I would like to allow the user to remove an item from my topic list.

In my installation, this will require “detaching” the associated section from this user queue.

I am using pyamqplib and I see no way to do this through a channel object. Their way to remove previously associated routing keys from the queue?

+5
source share
2 answers
public void unsubscribe(String queuename, String topic) throws IOException
{
   ConnectionFactory factory = new ConnectionFactory();
   factory.setHost(MQ_HOST);
   factory.setPort(MQ_PORT);

   Connection connection = factory.newConnection();
   Channel channel = connection.createChannel();
   try
   {
      channel.exchangeDeclarePassive("Channel name");
      channel.queueUnbind(queuename, "Channel name", topic);
   }
   finally
   {
      handleClose(connection, channel);
   }
}
+4
source

All Articles