Kafka Streams 在多个主题上以不同分区运行的最大任务数量是多少?

huangapple go评论51阅读模式
英文:

what is the maximum tasks for kafka streams on multiple topcis with different partition

问题

  • 假设我们有两个输入主题。Topic1有2个分区,Topic2有4个分区。
  • 我们使用1个线程创建了Kafka流应用程序。

问题:我们可以运行多少个流应用程序,以便每个都被分配一个分区?

根据我的理解,这取决于输入主题的最大分区数,即4个。

但是,我想要实现的是6个,即所有主题分区数的总和。您知道是否可行吗?谢谢。

英文:
  • Suppose we have two input topics. Topic1 has 2 partitions, and Topic2 has 4 partitions.
  • We create the kafka stream application with thread number 1.

Question: what is the maximum number that we can run the stream application that all will be assigned a partition?

as for my understanding, it is decided by the maximum partition of input topics. that is 4.

while what I want to achieve is 6, that is the sum number of all topics' partition. do you know is this doable? Thanks.

答案1

得分: 1

流应用程序的并行性是由输入主题中的分区数定义的,你说得对。这是无法更改的。一种解决方法是使用一个中间的重新分区主题:你可以将输入主题重新分区成一个具有6个分区的新主题,然后使用并行度为6来执行实际工作。

英文:

The parallelism of a streams application is defined number of partitions in the input topic(s), you are correct. You cannot change this. A workaround would be to work with an intermediate repartition topic: you repartition the input topic into a new topic with 6 partitions, and then do the actual work with a parallelism of 6.

huangapple
  • 本文由 发表于 2023年1月9日 17:29:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/75055297.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定