cody-greene / node-rabbitmq-client

RabbitMQ (0-9-1) client library with auto-reconnect & zero dependencies
MIT License
127 stars 9 forks source link

Question: Multi Node RabbitMQ / Failover #44

Closed Timeraa closed 7 months ago

Timeraa commented 7 months ago

In production we run RabbitMQ using Kubernetes with multiple nodes. I noticed that if a rabbitmq instance dies so does the process (Which to be expected if it was only one rabbitmq node) but usually it should just continue working / reconnect to the next rabbitmq instance as that one is still healthy.

I saw that amqplib doesn't support this either which is why amqp-connection-manager exists but I feel it would be a good addition to have it natively in this client as it is so far the best option for the future in node. I am not sure if this is a feature yet in this client, but if not is this something that is planned?

If not I may be able to help contribute to this with a PR (If I get some allocation from work).

Thanks in advance

cody-greene commented 7 months ago

Make sure you handle error events on the connection and consumer objects. It should reconnect already.

-------- Original Message -------- On Mar 14, 2024, 3:39 AM, Florian Metz wrote:

In production we run RabbitMQ using Kubernetes with multiple nodes. I noticed that if a rabbitmq instance dies so does the process (Which to be expected if it was only one rabbitmq node) but usually it should just continue working / reconnect to the next rabbitmq instance as that one is still healthy.

I saw that amqplib doesn't support this either which is why amqp-connection-manager exists but I feel it would be a good addition to have it natively in this client as it is so far the best option for the future in node. I am not sure if this is a feature yet in this client, but if not is this something that is planned?

If not I may be able to help contribute to this with a PR (If I get some allocation from work).

Thanks in advance

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Timeraa commented 7 months ago

Make sure you handle error events on the connection and consumer objects. It should reconnect already. -------- Original Message -------- On Mar 14, 2024, 3:39 AM, Florian Metz wrote: In production we run RabbitMQ using Kubernetes with multiple nodes. I noticed that if a rabbitmq instance dies so does the process (Which to be expected if it was only one rabbitmq node) but usually it should just continue working / reconnect to the next rabbitmq instance as that one is still healthy. I saw that amqplib doesn't support this either which is why amqp-connection-manager exists but I feel it would be a good addition to have it natively in this client as it is so far the best option for the future in node. I am not sure if this is a feature yet in this client, but if not is this something that is planned? If not I may be able to help contribute to this with a PR (If I get some allocation from work). Thanks in advance — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Ah okay! Yeah I was a bit unsure because amqp-connection-manager from what I assume connects to all of them to not have a downtime / queue downtime for a few miliseconds but I shall just do that then!