The RabbitMQ documentation presents how to add a shutdown listener and when the listener is called but I fail to see on what purpose the handler is for. Seems that all the Java examples (including https://github.com/rabbitmq/rabbitmq-tutorials) out there ignore shutdown handlers. In which cases should I prefer shutdown listener over simply catching ShutdownSignalException
(and IOException
) exception ?
Another puzzling issue is that where the control flow goes when the handler has finished.
Potentially relevant related SO questions: