Spring 云流:同一个应用中的两个不同的 Kafka

Spring cloud stream: Two different Kafkas in same app

我正在尝试在同一个应用程序中使用两个不同的 Kafka。

当我只有一个 Kafka 时,我的 application.yml 是:

spring:
  cloud:
    stream:
       kafka:
         binder:
           brokers: kafka_broker01
           zkNodes: kafka_broker01
           headers: type

       binders:
         some-binder:
           type: kafka
           inheritEnviroment: true

但是如果我在绑定中引用其他 Kafka 服务器,我不知道该怎么办:

  kafka:
    binder:
      brokers: other_kafka_broker01
      zkNodes: other_kafka_broker01
      headers: type

我该如何重新排列属性?

提前致谢。

你的问题太笼统了,所以我建议先看看 Multibinder samples which include several variations including Kafka. There is more information and details on multiple binder support in reference manual