从主题中的特定分区流式传输(Kafka流) [英] Streaming from particular partition within a topic (Kafka Streams)

查看:70
本文介绍了从主题中的特定分区流式传输(Kafka流)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我了解,在阅读Kafka Streams文档之后,不可能将其用于仅从给定主题的一个分区中流式传输数据,而始终必须完整地阅读该分区.

As far as I understand after reading Kafka Streams documentation, it's not possible to use it for streaming data from only one partition from given topic, one always have to read it whole.

对吗?

如果是这样,将来有没有计划向API提供这样的选项?

If so, are there any plans to provide such an option to the API in the future?

推荐答案

否,您不能这样做,因为内部使用者订阅了加入通过应用程序ID指定的使用者组的主题,因此分区是自动分配的. 顺便说一句,你为什么要这么做? 如果不进行重新平衡,您将失去Kafka Stream提供的可伸缩性功能,因为只需添加/删除流应用程序的实例,您就可以扩展整个过程,这要归功于分区的重新平衡.

No you can't do that because the internal consumer subscribes to the topic joining a consumer group which is specified through the application-id so the partitions are assigned automatically. Btw why do you want do that ? Without re-balancing you lose the scalability feature provided by Kafka Stream because just adding/removing instances of your streaming application you can scale the entire process, thanks to the re-balancing on partitions.

这篇关于从主题中的特定分区流式传输(Kafka流)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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