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

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

问题描述

据我阅读 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?

推荐答案

不,你不能这样做,因为内部消费者订阅主题,加入通过 application-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 Streams)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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