From 496a81393bbe632b71aa065ef563cf606e8abf88 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 26 Jul 2023 07:29:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Spring=20Cloud=20Bus=20Roc?= =?UTF-8?q?ketMQ=20=E6=97=A0=E6=B3=95=E5=B9=BF=E6=92=AD=E6=B6=88=E8=B4=B9?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yaml | 15 +++++++-------- .../src/main/resources/application.yaml | 6 +++++- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/application.yaml b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/application.yaml index 4401de904..c225ddaf9 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/application.yaml +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/application.yaml @@ -77,15 +77,10 @@ spring: cloud: # Spring Cloud Stream 配置项,对应 BindingServiceProperties 类 stream: - # function: - # definition: roleRefreshConsumer;roleMenuRefreshConsumer;userRoleRefreshConsumer; + function: + definition: busConsumer # Binding 配置项,对应 BindingProperties Map - bindings: - roleRefresh-out-0: - destination: system_role_refresh - roleRefreshConsumer-in-0: - destination: system_role_refresh - group: system_role_refresh_consumer_group +# bindings: # Spring Cloud Stream RocketMQ 配置项 rocketmq: # RocketMQ Binder 配置项,对应 RocketMQBinderConfigurationProperties 类 @@ -95,6 +90,10 @@ spring: producer: # RocketMQ Producer 配置项,对应 RocketMQProducerProperties 类 group: infra_producer_group # 生产者分组 send-type: SYNC # 发送模式,SYNC 同步 + bindings: + springCloudBusInput: + consumer: + message-model: BROADCASTING # 重要,解决 Spring Cloud Bus RocketMQ 默认不是 BROADCASTING 广播消费的问题 # Spring Cloud Bus 配置项,对应 BusProperties 类 bus: diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/application.yaml b/yudao-module-system/yudao-module-system-biz/src/main/resources/application.yaml index cac51c174..c3578f065 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/resources/application.yaml +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/application.yaml @@ -74,7 +74,7 @@ spring: # Spring Cloud Stream 配置项,对应 BindingServiceProperties 类 stream: function: - definition: smsSendConsumer;mailSendConsumer; + definition: busConsumer;smsSendConsumer;mailSendConsumer # Binding 配置项,对应 BindingProperties Map bindings: smsSend-out-0: @@ -96,6 +96,10 @@ spring: producer: # RocketMQ Producer 配置项,对应 RocketMQProducerProperties 类 group: system_producer_group # 生产者分组 send-type: SYNC # 发送模式,SYNC 同步 + bindings: + springCloudBusInput: + consumer: + message-model: BROADCASTING # 重要,解决 Spring Cloud Bus RocketMQ 默认不是 BROADCASTING 广播消费的问题 # Spring Cloud Bus 配置项,对应 BusProperties 类 bus: