Intermittent Connection Issues to RabbitMQ from Python Application running in Docker
I have a Python application running in Docker container that connects to a RabbitMQ instance using aio_pika (connect_robust). RabbitMQ is hosted on an EC2 instance. Most of the time, the application runs as expected, but occasionally the connection is timeout, and reconnect attempts fail. The RabbitMQ logs show the following error:
2024-11-14 06:31:51.848917+00:00 [error] <0.138943.0> {inet_error,etimedout}
2024-11-14 06:31:51.849283+00:00 [error] <0.138971.0> closing AMQP connection <0.138971.0> (10.218.139.209:55580 -> 10.218.139.197:5672, duration: '13H, 40M, 49s'):
Restarting RabbitMQ service or the application container itself does not resolve the issue. However, if I restart the Docker service, then the application is able to connect again to RabbitMQ.
Has anyone encountered a similar issue or have any ideas on what could be causing this problem?
Read more here: Source link
