在 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应用程序中连接到多个集群?
发布评论