此版本仍在开发中,尚未被视为稳定版本。对于最新的稳定版本,请使用 spring-cloud-stream 4.1.4! |
绑定服务属性
这些属性通过org.springframework.cloud.stream.config.BindingServiceProperties
- spring.cloud.stream.instanceCount
-
应用程序已部署实例的数量。 必须设置为在生产者端进行分区。使用 RabbitMQ 时必须在消费者端设置,如果
autoRebalanceEnabled=false
.违约:
1
. - spring.cloud.stream.instanceIndex的
-
应用程序的实例索引:来自
0
自instanceCount - 1
. 用于使用 RabbitMQ 和 Kafka 进行分区 ifautoRebalanceEnabled=false
. 在 Cloud Foundry 中自动设置以匹配应用程序的实例索引。 - spring.cloud.stream.dynamicDestinations
-
可以动态绑定的目标列表(例如,在动态路由场景中)。 如果设置,则只能绑定列出的目标。
默认值:空(允许绑定任何目标)。
- spring.cloud.stream.defaultBinder 的
-
如果配置了多个 Binder,则为要使用的默认 Binder。 参见 Classpath 上的多个 Binders。
默认值:空。
- spring.cloud.stream.overrideCloudConnectors
-
此属性仅在
cloud
profile 处于活动状态,并且 Spring Cloud Connector 随应用程序一起提供。 如果属性为false
(默认值),Binder 会检测合适的绑定服务(例如,在 Cloud Foundry 中为 RabbitMQ Binder 绑定的 RabbitMQ 服务)并使用它来创建连接(通常通过 Spring Cloud Connectors)。 当设置为true
中,此属性指示 Binders 完全忽略绑定的服务并依赖于 Spring Boot 属性(例如,依赖于spring.rabbitmq.*
属性)。 此属性的典型用法是在连接到多个系统时嵌套在自定义环境中。违约:
false
. - spring.cloud.stream.bindingRetryInterval
-
重试创建绑定之间的时间间隔(以秒为单位),例如,当 Binder 不支持后期绑定且代理(例如 Apache Kafka)已关闭时。 将其设置为零可将此类情况视为致命情况,从而阻止应用程序启动。
违约:
30