绑定服务属性

这些属性通过以下方式被揭示org.springframework.cloud.stream.config.BindingServicePropertiesspring-doc.cadn.net.cn

spring.cloud.stream.instanceCount

应用程序部署实例的数量。必须在生产者端设置分区。使用RabbitMQ时,且在Kafka中,必须在消费者端设置,如果autoRebalanceEnabled=false.spring-doc.cadn.net.cn

spring.cloud.stream.instanceIndex

应用的实例索引:一个数字来自0实例计数 - 1. 用于与RabbitMQ及Kafka进行分区,如果autoRebalanceEnabled=false. 在Cloud Foundry中自动设置为与应用的实例索引匹配。spring-doc.cadn.net.cn

spring.cloud.stream.dynamic目的地

一个可以动态绑定的目的地列表(例如,在动态路由场景中)。如果设置为,只有列出的目的地可以绑定。spring-doc.cadn.net.cn

默认值:空(允许任何目的地被绑定)。spring-doc.cadn.net.cn

spring.cloud.stream.defaultBinder

如果配置了多个绑定器,默认使用的绑定器。请参见类路径上的多个绑定器。spring-doc.cadn.net.cn

默认:空。spring-doc.cadn.net.cn

spring.cloud.stream.overrideCloudConnectors

该性质仅适用于以下情况配置文件处于激活状态,应用程序中附带了 Spring Cloud 连接器。如果属性是false(默认情况下),绑定器检测到合适的绑定服务(例如,RabbitMQ 绑定器在 Cloud Foundry 中绑定的 RabbitMQ 服务),并利用它来创建连接(通常通过 Spring Cloud Connectors)。当设置为true,该性质指示绑定器完全忽略绑定服务,而依赖Spring Boot属性(例如,依赖Spring.兔子问题。*RabbitMQ 绑定器环境中提供的属性)。该属性的典型用途是在连接多个系统时嵌套于定制环境中。spring-doc.cadn.net.cn

违约:false.spring-doc.cadn.net.cn

spring.cloud.stream.bindingRetryInterval

当绑定器不支持延迟绑定且代理(例如 Apache Kafka)无法启动时,重试绑定创建之间的间隔(以秒为单位)。将该时间设置为零以将此类情况视为致命,阻止应用程序启动。spring-doc.cadn.net.cn