问题描述
Kafka版本:1.0.0
假设流应用程序使用低级处理器API,该API维护状态并从具有10个分区的主题中读取数据.请说明是否希望内部主题使用相同数量的分区创建,或者是根据代理默认值创建的.如果是较晚的版本,如果我们需要增加内部主题的分区,有什么选择吗?
Kafka version: 1.0.0
Let's say the stream application uses low level processor API which maintains the state and reads from a topic with 10 partitions. Please clarify if the internal topic is expected to be created with the same number of partitions OR is it per the broker default. If it's the later, if we need to increase the partitions of the internal topic, is there any option?
推荐答案
Kafka Streams将为您创建主题.是的,它将使用与您的输入主题相同的分区数来创建它.在启动过程中,Kafka Streams还会检查主题是否具有预期的分区数,否则将失败.
Kafka Streams will create the topic for you. And yes, it will create it with the same number of partitions as your input topic. During startup, Kafka Streams also checks if the topic has the expected number of partitions and fails if not.
内部主题基本上是一个常规主题,您可以像其他任何主题一样通过命令行工具来更改分区数.但是,这绝对不是必需的.另外请注意,删除/添加分区会弄乱您的状态.
The internal topic is basically a regular topic as any other and you can change the number of partitions via command line tools like for any other topic. However, this should never be required. Also note, that dropping/adding partitions, will mess up your state.
这篇关于Kafka Streams:内部主题分区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!