I'm trying to gracefully shutdown a process that is consuming messages off RabbitMQ. I know that I can use Channel.cancel
to stop RabbitMQ from sending any new messages to the process, but I need to deal with any pending, unacknowledged messages as well. I could just call Channel.nackAll
and re-queue all of them, but it would be better if I could wait till all of the pending messages - messages that were consumed, but not yet acked/nacked - were done.
Any ideas how to achieve this?