alibaba/spring-cloud-alibaba

怎样在spring cloud stream整合rocketmq中使用多binder配置

Opened this issue · 0 comments

我们鼓励使用英文,如果不能直接使用,可以使用翻译软件,您仍旧可以保留中文原文。另外请按照如下要求提交相关信息节省社区维护同学的理解成本,否则该讨论极有可能直接被忽视或关闭。
We recommend using English. If you are non-native English speaker, you can use the translation software. We recommend using English. If you are non-native English speaker, you can use the translation software. In addition, please submit relevant information according to the following requirements to save the understanding cost of community maintenances, otherwise the discussion is very likely to be ignored or closed directly.

Which Component
spring-cloud-starter-stream-rocketmq

Describe what problem you have encountered
你好,我使用的版本是spring cloud alibaba 2022.0.0.0

请问怎样在spring cloud stream整合rocketmq中使用多binder配置,不同的producer和consumer连接不同的集群

我尝试使用spring cloud stream中的配置方式,如下所示,发现无法生效,
查看了源码,spring.binders中,只有rocketmq:com.alibaba.cloud.stream.binder.rocketmq.autoconfigurate.RocketMQBinderAutoConfiguration,
在RocketMQBinderConfigurationProperties类中写死了配置@ConfigurationProperties(prefix = "spring.cloud.stream.rocketmq.binder")
所以只能加载一个binder配置,现在是不支持多binder配置吗?如果支持的话请问怎样配置或者需要怎样进行二次开发?

谢谢!

binders:
    rokcetmq1:
      type: rocketmq
      defaultCandidate: false
     ......
    rocketmq2:
      type: rocketmq
      defaultCandidate: false
      .......

bindings:
      test1-in-0:
        destination: test1-topic
        group: test1-consumer-group
        content-type: application/json
        binder: rokcetmq1  #这里报错
      test2-out-0:
         destination: test2-topic
         group: test2-producer-group
         content-type: application/json
         binder: rokcetmq2 #这里报错

Describe what information you have read
官方文档里没有rocketmq多binder的配置示例和说明