sublinks / sublinks-federation

Federation service for Sublinks
MIT License
11 stars 4 forks source link

Support auto-restart on queue disconnect #119

Open lazyguru opened 4 months ago

lazyguru commented 4 months ago

When RabbitMQ goes offline, the consumer throws errors and kills the main process.

{"level":"error","error":"consumer channel closed","message":"consumer channel closed"}
{"level":"error","error":"consumer channel closed","message":"consumer channel closed"}
{"level":"fatal","error":"Exception (504) Reason: \"channel/connection is not open\"","message":"failed starting object consumer"}
{"level":"fatal","error":"Exception (504) Reason: \"channel/connection is not open\"","message":"failed starting actor consumer"}
fatal error: Process Exit with Code: 1
{"level":"error","error":"consumer channel closed","message":"consumer channel closed"}
{"level":"error","error":"consumer channel closed","message":"consumer channel closed"}
{"level":"fatal","error":"Exception (504) Reason: \"channel/connection is not open\"","message":"failed starting object consumer"}
{"level":"fatal","error":"Exception (504) Reason: \"channel/connection is not open\"","message":"failed starting actor consumer"}
fatal error: Process Exit with Code: 1

It would be nice if we can handle this more gracefully and potentially go into a retry loop attempting to re-establish the connection. At a minimum, we should be able to function without the queue and just stack up requests to be sent once it is available again.