There is an <address>
field in the ConnectionFactory
of Spring AMQP, so I have to specify address of all the nodes in the cluster in that field or ican just write address of one node of the cluster and it can get details of other nodes automatically?
On the producer side, you can publish to any member of the cluster.
On the consumer side, if the queues are HA, then you can connect to any member of the cluster (to which the queue is mirrored). For non-mirrored queues you have to connect to the instance that owns the queue.
Providing a list of addresses to the connection factory is just for failover; the client will try to connect to each instance in the order they are provided.
EDIT
You can discover the cluster members by using the REST API (http-client jar)...
Client client = new Client("http://10.0.0.3:15672/api/", "guest", "guest");
System.out.println(client.getNodes());
The information doesn't include ip addresses, but the node names are usually rabbit@host
.