[rabbitmq-discuss] How can I connect in a cluster using Java library

Lucas Souza lucasas at gmail.com
Wed Mar 16 13:48:22 GMT 2011


Give me a example, please.

Can I try this example on Java Client Library:

ConnectionFactory factory = new ConnectionFactory();
Address[] addresses = {new Address("localhost", 12345), new
Address("localhost", 12346)};
factory.newConnection(addresses);

If I'll do this, how can I know what node of cluster I'm connected?

If node 1 down, but node 2 still up, how can I reconnect in node 1?

Thanks Emile.

Regards.

Lucas Ap. Souza



On 16 March 2011 06:43, Emile Joubert <emile at rabbitmq.com> wrote:

> Hi Lucas,
>
> On 15/03/11 21:34, Lucas Souza wrote:
>
>> Hi everybody...
>>
>> How can I connect in a cluster using Java client library?
>>
>
> A rabbit client (including the Java client) will work unchanged whether
> connecting to single or a clustered broker. When connecting to a cluster, it
> makes little difference which node in the cluster a client connects to
> (except for queue declarations).
>
> You should take a look at the clustering guide for instructions on how to
> set up a cluster using the rabbitmqctl commandline utility:
> http://www.rabbitmq.com/clustering.html
>
> Regards
>
> Emile
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110316/8d39738f/attachment.htm>


More information about the rabbitmq-discuss mailing list