简体   繁体   English

属性 spring.cloud.stream.bindings 有什么用。<channelname> .consumer.partitioned</channelname>

[英]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.

相关问题 我可以使用spring.cloud.stream.bindings吗? <channel> .group何时使用RabbitMQ获得一次准确的交货? - Can I use spring.cloud.stream.bindings.<channel>.group when using RabbitMQ to obtain exactly-once delivery? spring.cloud.stream.kafka.bindings。<channelname> .producer.configuration 未应用</channelname> - spring.cloud.stream.kafka.bindings.<channelName>.producer.configuration is not applied 支持为 spring 云中的每个消费者绑定定义 spring.json.key.type - Support for defining spring.json.key.type for each consumer binding in spring cloud stream bindings 如何使用RMQ和Spring Cloud Stream创建基于分区的使用者 - How to use RMQ and spring cloud stream for creating partition based consumer Eventhub 主题分区数与 spring.cloud.stream.bindings.input.consumer.concurrency 的关系 - Relation between Eventhub topic partition count and spring.cloud.stream.bindings.input.consumer.concurrency Spring 云 Stream 消费者启动 - Spring Cloud Stream consumer startup 如何将 spring.cloud.stream.kafka.bindings 配置属性应用于所有消费者 - How to apply spring.cloud.stream.kafka.bindings configuration property to all consumers 如何自动装配Spring Stream Cloud绑定 - How to autowire spring stream cloud bindings spring 云 stream 供应商和消费者未触发 - spring cloud stream supplier and consumer not triggered 春季云流的DLQ分区Kafka主题 - Partitioned Kafka Topic for DLQ for spring-cloud-stream
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM