[rabbitmq-discuss] How can I connect in a cluster using Java library
Lucas Souza
lucasas at gmail.com
Thu Mar 17 17:10:21 GMT 2011
Thanks for help me Matthew...
Coming soon I'll post what I did. You clarified my ideas.
Regards
On 17 mar, 13:10, Matthew Sackman <matt... at rabbitmq.com> wrote:
> Greetings!
>
> On Thu, Mar 17, 2011 at 08:52:40AM -0700, Lucas Souza wrote:
> > Do you recommend that I use a HAProxy in front my Rabbits? Or Can I do
> > this:
>
> > ConnectionFactory factory = new ConnectionFactory();
> > Address[] addresses = {new Address("localhost", 12345), new
> > Address("localhost", 12346)};
> > factory.newConnection(addresses);
>
> You can certainly do that. However, that's baking into your code both
> ports and addresses, which means that should you need to migrate your
> cluster/ha-setup elsewhere, you'll have to recompile your clients. Thus
> it might be better to us something like ha-proxy, or maybe just
> DNS (round-robin or not) with a very short TTL will suffice. There are
> many ways to skin this particular Rabbit...
>
> Matthew
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-disc... at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
More information about the rabbitmq-discuss
mailing list