[英]what is the use of the property spring.cloud.stream.bindings.<channelName>.consumer.partitioned
What will happen If partitionCount (spring.cloud.stream.bindings..producer.partitionCount) is greater than 1 and consumer.partitioned (spring.cloud.stream.bindings..consumer.partitioned) is false (Using Kafka)如果 partitionCount (spring.cloud.stream.bindings..producer.partitionCount) 大于 1 并且 consumer.partitioned (spring.cloud.stream.bindings..consumer.partitioned) 为 false 会发生什么(使用 Kafka)
In the case of Kafa binder, the property spring.cloud.stream.bindings..consumer.partitioned
is not relevant.对于 Kafa binder,属性spring.cloud.stream.bindings..consumer.partitioned
不相关。 You can skip setting this property on the consumer side.您可以跳过在消费者端设置此属性。 This property's default value is false
.此属性的默认值为false
。 Since Kafka has built-in partitioning support, the binder will simply delegate to Kafka broker and Kafka decides on which partitions to consume from.由于 Kafka 具有内置的分区支持,binder 将简单地委托给 Kafka 代理,Kafka 决定从哪些分区消费。 If you only have one consumer, then it will consume from all the partitions.如果您只有一个消费者,那么它将从所有分区中消费。 If you have more than one consumer, Kafka will do a rebalance and split the partitions across the available consumers (assuming that the autoRebalanceEnabled
property remains true
to it's default value).如果您有多个消费者,Kafka 将执行重新平衡并在可用消费者之间拆分分区(假设autoRebalanceEnabled
属性true
为默认值)。
You can set spring.cloud.stream.bindings..consumer.partitioned
to true, if you want to set instance index id on the consumers (for eg if you want to run the app on certain platforms or achieve static partitioning). You can set spring.cloud.stream.bindings..consumer.partitioned
to true, if you want to set instance index id on the consumers (for eg if you want to run the app on certain platforms or achieve static partitioning). In this case, you need to provde the instance index or list of instance index to the consumer.在这种情况下,您需要向消费者提供实例索引或实例索引列表。 However, I think this is irrelvant for your use case.但是,我认为这与您的用例无关。
The upshot here is that you can safely ignore, spring.cloud.stream.bindings..consumer.partitioned
on the consumer side if you are using Kafka binder and auto rebalance is enabled.这里的结果是您可以放心地忽略spring.cloud.stream.bindings..consumer.partitioned
在消费者端,如果您使用 Kafka binder 并启用了自动重新平衡。
We have some basic partitioning samples here that you may want to take a look at.我们在这里有一些基本的分区示例,您可能想看看。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.