RabbitMq is used in our application There are hundreds of messeges accumulated in time, in unacked state for couple of queues, and TTLs isn't working because of several unexpected shutdowns when the listener wasn't alive .
Now for business reason I cant just empty the queue. I want to push the unacked messages manually to ready state.
Is there any ??
Thanks !
there are 2 ways to move a message from unack'd to ready:
1) ack the message from your consumer
2) shut down the consumer that is holding them open
most likely, option #1 is not really an option. when a message gets stuck in unack'd, it's usually because the consumer lost track of the message and can't ack it anymore.
this typically leaves #2: you'll need to shut down all consumers that had previously been attached to that queue. when a message is unack'd and the consumer drops, RMQ will push the message back into ready.
if you shut down your consumers and restarting them puts the messages back into unack'd state, then you need to figure out what's causing the error in your consumer, fix the code and restart it again.
Another way would be to simply restart the rabbitmq instance.
/etc/init.d/rabbitmq-server restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With