senecajs / seneca-amqp-transport

Official AMQP transport plugin for Seneca
MIT License
68 stars 25 forks source link

Is there a way to handle channel close as fatal? #135

Open me23 opened 5 years ago

me23 commented 5 years ago

Hi,

we haven a microservice running in docker. if rabbitmq dies (or if i kill it with docker kill) Seneca exit with StatusCode 1. Which then stops the docker container. We run it with restart=always so that the docker tries to restart the microservice. After rabbitmq comes back the service registered it self on rabbitmq like expected.

If i use docker stop or restart instead of kill. Then seneca exit with StatusCode 0. Now docker don't recognize the container in a fail state and therefor no restart occurs. Which will end up in the container running but without the service listening on rabbitmq anymore.

Is there a way to configure a channel close to exit the process with StatusCode > 0? Or are there better ways of doing it?

Thank you me23