Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple server URLs #215

Closed
dglozic opened this issue Aug 15, 2014 · 7 comments
Closed

Support for multiple server URLs #215

dglozic opened this issue Aug 15, 2014 · 7 comments

Comments

@dglozic
Copy link

dglozic commented Aug 15, 2014

Here is something we just noticed: it would be great if we could specify more than one server URL in the client. This would be in context of an HA configuration (with, say, two RabbitMQ nodes configured in clustered mode). I checked Eclipse PAHO Java client and it already supports it via 'setServerURLs(String [] urls)'. I looked around a bit and setting up TCP load balancers in front of MQTT server array may be more trouble than its worth.

So maybe add it to the pile of ideas when you rewrite the client as hinted in issue 211 :-) ?

@dglozic
Copy link
Author

dglozic commented Aug 17, 2014

A did a bit of extra digging and since we are also using node-amqp module, I found out that it allows for the 'host' property to be specified as an array. An array of URLs would be more flexible, but if you set up multiple RabbitMQ nodes using the same port, user and password, it would work (although it is harder to test locally since you cannot install two rabbitmq instances in localhost without using different port numbers).

@mcollina
Copy link
Member

@dglozic you can submit a PR now :).
This is something we can get added quickly for the main MQTT Client.

@dglozic
Copy link
Author

dglozic commented Aug 17, 2014

I was searching around a bit and found that an alternative would be to stand up an HAProxy in front of RabbitMQ nodes and continue to use one virtual address. HAProxy would handle TCP proxying and health checks/failover. We will try that first. Or even LVS on our Linux VMs.

The advantage of the client handling multiple URLs is that you don't add another single point of failure that you need a backup for :-).

@mcollina
Copy link
Member

If you are on AWS, you can use ElasticLoadBalancer.

@dglozic
Copy link
Author

dglozic commented Aug 17, 2014

It came across in my searches, although considering I work for IBM, I am most decidedly not on AWS :-).

@mcollina
Copy link
Member

Yep, but that's something that might help lots of people too ;).

@dglozic
Copy link
Author

dglozic commented Aug 17, 2014

Yes, sorry, I forgot am not the only one reading these issue :-).

@mcollina mcollina mentioned this issue Nov 29, 2014
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants