Kafka Streams:内部主题分区 [英] Kafka Streams: Internal topic partitions

查看:26
本文介绍了Kafka Streams:内部主题分区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Kafka 版本:1.0.0
假设流应用程序使用低级处理器 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:内部主题分区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆