Reputation: 2195
I read the documentation: https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html#common-application-properties and it is not clear to me how these two properties work together:
spring.rabbitmq.host=address1
spring.rabbitmq.addresses=address1,address2
I'm working with a cluster of several hosts, can I only specify the addresses
property? I don't want the host
property to be searching for localhost
(default value if you do not specify it).
Upvotes: 0
Views: 512
Reputation: 174554
They don't work "together". Use host
(or addresses
) for a single server, addresses
for a cluster.
host
is ignored if addresses
is provided.
That should be clarified that in the Boot documentation.
The connection factory Javadocs make it clear...
/**
* Set addresses for clustering.
* This property overrides the host+port properties if not empty.
* @param addresses list of addresses with form "host[:port],..."
*/
public void setAddresses(String addresses) {
Upvotes: 1