Connecting grails rabbitmq plugin to multiple hosts

211 Views Asked by At

Is there a way to configure the grails rabbitmq plugin to connect to a clustered rabbitmq environment for failover, or if there is alternative library/plugin I could use to achieve that.

grails 2.2.0 rabbitmq 1.0.0

1

There are 1 best solutions below

0
On

I don't think there is an easy way to do this in grails alone...

I would recommend using a load balancer in front of your rabbitmq cluster. This allows you to route traffic to other nodes in the cluster if one fails. Once you have the load balancer configured, just point your rabbitmq.connectionfactory.hostname to the load balancer and it will do the rest!

Load balancer configuration varies depending on the type you use. If you don't already have a load balancer, HAProxy is a good option. There are some good examples online, and step-by-step instructions in the "RabbitMQ in Action" book (if you have it).