is there a way to get "reconnect" to rabbitMQ if connection lost? How can I reconnect to rabbitmq? What's the best way? Is there any "strategy"?
Asked
Active
Viewed 601 times
1
-
1This depends heavily on the use-case. It gets a lot trickier to handle graceful retries if you are consuming a lot and have a low tolerance for data loss. I usually apply something like this (sorry for a different library, but should work fine for pika as well) https://github.com/eandersson/amqpstorm/blob/master/examples/robust_consumer.py – eandersson Mar 09 '21 at 00:58