如何在单个Kafka Streams应用程序中连接到多个集群?

编程入门 行业动态 更新时间:2024-10-11 13:30:32
本文介绍了如何在单个Kafka Streams应用程序中连接到多个集群?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在 Kafka Streams开发人员指南中说:

Kafka Streams应用程序只能与单个Kafka集群通信 由此配置值指定. Kafka Streams的未来版本将 支持连接到不同的Kafka集群以读取输入流和 编写输出流.

Kafka Streams applications can only communicate with a single Kafka cluster specified by this config value. Future versions of Kafka Streams will support connecting to different Kafka clusters for reading input streams and writing output streams.

这是否意味着我的整个应用程序只能连接到单个Kafka群集或 KafkaStreams 只能连接到单个群集吗?

Does this mean that my whole application can only connect to a single Kafka Cluster or each instance of KafkaStreams can only connect to a single cluster?

我可以创建多个具有不同属性并连接到不同集群的KafkaStreams实例吗?

Could I create multiple KafkaStreams instances with different properties that connect to different clusters?

推荐答案

这意味着单个应用程序只能连接到一个群集.

It means that a single application can only connect to one cluster.

  • 您无法从群集A中读取主题,也无法将计算结果写入群集B.
  • 不可能从具有相同实例的两个不同集群中读取两个主题.

我可以创建多个具有不同属性并连接到不同集群的KafkaStreams实例吗?

Could I create multiple KafkaStreams instances with different properties that connect to different clusters?

是的,绝对如此.但是那些不同的实例将是不同的应用程序. (请考虑消费者群体".)

Yes, absolutely. But those different instances will be different applications. (Think "consumer groups".)

更新:

在单个JVM中,您可以根据需要创建任意多个KafkaStreams实例.您还可以将它们配置为连接到不同的群集(如果要执行相同的处理,可以对所有群集使用相同的KStreamBuilder).

Within a single JVM, you can create as many KafkaStreams instances as you like. You can also configure them to connect to different clusters (and you can use the same KStreamBuilder for all of them if you want to do the same processing).

更多推荐

如何在单个Kafka Streams应用程序中连接到多个集群?

本文发布于:2023-11-25 15:01:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1630215.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   集群   连接到   应用程序   如何在

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!