5

I am using RabbitMQ (cluster) and connecting to it using a Node.js client (node-amqp - https://github.com/postwait/node-amqp). The RabbitMQ docs states that handling a failover scenario (cluster's node failure) should be handled by the client meaning the client should detect the fail and connect to another node in the cluster. What is the simplest way to support this failover balancing. Is the node-amqp client support this ? Any example or solution will be appreciated.

Thanks.

Momico
  • 85
  • 1
  • 8
  • AFAIK there's no support for this in any of the node clients. You would have to implement that yourself. – old_sound Jun 26 '14 at 12:50

1 Answers1

0

node-amqp has support for multiple server hosts in the connection object. So input host: as an array of hosts (unfortunately only the host part accepts an array, so other parameters like port and authentication has to match across you rabbit servers).

Anders Bornholm
  • 1,326
  • 7
  • 18
  • Yes you can provide an array of hosts, but it doesn't support failover. It randomly pick a host but if the connection fail, it will throw an exception without trying the other host. – Matthew Lai Dec 14 '17 at 07:42