Spring Cloud Stream with RabbitMQ 集群配置属性
Spring Cloud Stream with RabbitMQ cluster configuration properties
我阅读了文档:https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html#common-application-properties 我不清楚这两个属性如何协同工作:
spring.rabbitmq.host=address1
spring.rabbitmq.addresses=address1,address2
我正在使用由多个主机组成的集群,我可以只指定 addresses
属性 吗?我不希望 host
属性 搜索 localhost
(如果不指定则为默认值)。
它们不起作用 "together"。对单个服务器使用 host
(或 addresses
),对集群使用 addresses
。
如果提供 addresses
,host
将被忽略。
引导文档中应该对此进行说明。
connection factory Javadocs说清楚...
/**
* 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) {
我阅读了文档:https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html#common-application-properties 我不清楚这两个属性如何协同工作:
spring.rabbitmq.host=address1
spring.rabbitmq.addresses=address1,address2
我正在使用由多个主机组成的集群,我可以只指定 addresses
属性 吗?我不希望 host
属性 搜索 localhost
(如果不指定则为默认值)。
它们不起作用 "together"。对单个服务器使用 host
(或 addresses
),对集群使用 addresses
。
addresses
,host
将被忽略。
引导文档中应该对此进行说明。
connection factory Javadocs说清楚...
/**
* 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) {