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 220.127.116.11:38182 is related to the queue with unacked messages.
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.
Press the connection that belongs to the chhannel, and them press "Force Close" from the bottom of the management interface.
A connection can also be closed via code, please read the article FAQ: How to close connections in RabbitMQ? for more information.
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
The timeout value is configurable in [rabbitmq.conf] (in milliseconds):
# 30 minutes in milliseconds
consumer_timeout = 1800000