Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lionhuo opened this issue Dec 12, 2024 · 0 comments
Open

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

lionhuo opened this issue Dec 12, 2024 · 0 comments

Comments

@lionhuo
Copy link

lionhuo commented Dec 12, 2024

我们鼓励使用英文,如果不能直接使用,可以使用翻译软件,您仍旧可以保留中文原文。另外请按照如下要求提交相关信息节省社区维护同学的理解成本,否则该讨论极有可能直接被忽视或关闭。
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的配置示例和说明

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant