# FAQ: How to purge unacked messages from a queue in RabbitMQ

By Lovisa Johansson. Published 16 June 2022.

Question: Multiple queues in our broker have a lot of messages. We tried to clear the piled-up messages by purging the queue, but only the ready state queues got deleted. There are still queues with messages that are in an "unacked" state. How can I clear them?

Close the channel that the unacked messages reside on, which requires you to add the messages back to the queue into a ready state. Then, purge the queue. The channel related to a consumer can be seen by pressing the queue with unacked messages. In the image, channel _54.175.17.49:38182_ is related to the queue with unacked messages.

![](/img/blog/channel-related-to-queue.png)

All channels on a connection will be closed when you close the connection that the channel belongs to. The connection can be closed via the management interface.

![](/img/blog/connection-relaetd-to-channel.png)

Press the connection that belongs to the chhannel, and them press “Force Close” from the bottom of the management interface.

![](/img/blog/close-connection-related-to-channel.png)

A connection can also be closed via code, please read the article [FAQ: How to close connections in RabbitMQ?](/blog/how-to-close-all-connections-rabbitmq/) for more information.

## Consumer Timeout

Recent versions of RabbitMQ include the ability to configure a consumer timeout, which is the maximum time a consumer can spend processing a message before the channel is terminated.

If a consumer does not ack its delivery for more than the timeout value (30 minutes by default), its channel will be closed with a `PRECONDITION_FAILED` channel exception.

The timeout value is configurable in [rabbitmq.conf] (in milliseconds):

```ruby
# 30 minutes in milliseconds
consumer_timeout = 1800000
```
