I'm having some problems with RabbitMQ and dead connections. I have a RabbitMQ server and many ec2 instances that connect and comsumes messagens from this server. The problem is that sometimes when I need to terminate an ec2 instance, its conection with RabbitMQ server is not closed.
Because of this we start to see unacked messages that never get back to the ready state. What I currenlty do is use rabbitmqctl to remove this connections and/or use a python script I wrote to kill any connection that is idle for more than X days.
I already tried using the heatrbeat[1] RabbitMQ option, but the problem still occurs. What I would like to do is to automatically close any "dead" (idle for a long time) connections.
Is this something I set in the client side, instead of the server side?
RabbitMQ is 3.3.4 and we use py-amqp[2] on the clients.
[1] https://www.rabbitmq.com/configure.html [2] https://github.com/celery/py-amqp