赞
踩
SpringCloud之Stream消息驱动RocketMQ讲解_rocketmq stream_爱吃牛肉的大老虎的博客-CSDN博客3.0使用的函数式消费,如果使用广播消费,就是配置2个group,destination和生产者保持一致即可
- spring.cloud.stream:
- bindings:
- testData-in-0:
- destination: test-data-x-qmh
- group: test-consume-group-x-dev
- consumer:
- concurrency: 9
- batch-mode: true
- testDataMMC-in-0:
- destination: test-data-x-qmh
- group: test-consume-group-mmc
- consumer:
- concurrency: 9
- batch-mode: true
- rocketmq:
- bindings:
- testData-in-0:
- consumer:
- orderly: false
- testDataMMC-in-0:
- consumer:
- orderly: false
-
- spring.cloud.function.definition: testData;testDataMMC;
java代码如下:
- @Bean
- Consumer<xx> testDataMMC() {
- return g -> {};
- }
- @Bean
- Consumer<xx> testData() {
- return g -> {};
- }
我在配置好之后,遇到只有1个被消费的情况,查看控制台,发现另外一个队列延迟了消息。这里不清楚是不是配置的问题,我简单的换了个group的名字重启解决,可能是之前的group消息堆积了
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。