当前位置:   article > 正文

SpringCloud之Stream3.0广播消息_springcloudstream3.0后

springcloudstream3.0后

SpringCloud之Stream消息驱动RocketMQ讲解_rocketmq stream_爱吃牛肉的大老虎的博客-CSDN博客3.0使用的函数式消费,如果使用广播消费,就是配置2个group,destination和生产者保持一致即可

  1. spring.cloud.stream:
  2. bindings:
  3. testData-in-0:
  4. destination: test-data-x-qmh
  5. group: test-consume-group-x-dev
  6. consumer:
  7. concurrency: 9
  8. batch-mode: true
  9. testDataMMC-in-0:
  10. destination: test-data-x-qmh
  11. group: test-consume-group-mmc
  12. consumer:
  13. concurrency: 9
  14. batch-mode: true
  15. rocketmq:
  16. bindings:
  17. testData-in-0:
  18. consumer:
  19. orderly: false
  20. testDataMMC-in-0:
  21. consumer:
  22. orderly: false
  23. spring.cloud.function.definition: testData;testDataMMC;

java代码如下:

  1. @Bean
  2. Consumer<xx> testDataMMC() {
  3. return g -> {};
  4. }
  5. @Bean
  6. Consumer<xx> testData() {
  7. return g -> {};
  8. }

我在配置好之后,遇到只有1个被消费的情况,查看控制台,发现另外一个队列延迟了消息。这里不清楚是不是配置的问题,我简单的换了个group的名字重启解决,可能是之前的group消息堆积了

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/840812
推荐阅读
相关标签
  

闽ICP备14008679号