From f45f87647b5bd0eedf4d570b39ded7f17f6a4e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=90=AF=E6=98=8E?= <455043818@qq.com> Date: Wed, 22 Nov 2023 20:42:50 +0800 Subject: [PATCH] Update 2023-11-21-dotnetcore.md --- docs/javascript/2023-11-21-dotnetcore.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/javascript/2023-11-21-dotnetcore.md b/docs/javascript/2023-11-21-dotnetcore.md index 0b90be55b0..f403a745be 100644 --- a/docs/javascript/2023-11-21-dotnetcore.md +++ b/docs/javascript/2023-11-21-dotnetcore.md @@ -247,5 +247,19 @@ DVS.Basic/Templates/Menu.json ## rabbitmq 异步任务处理 ``` + // 首先在Program.cs中注册调用 builder.Services.InitServices + + // 其中 通过services.AddDistributedEventBus(configuration); + + // 实现读取配置文件中的rabbitmq配置信息 + // 以及通过依赖注册将RabbitMQEventPublisher 发布者和 RabbitMQEventSubscriber 消费者注册到容器中 + + //将所有的处理事件通过 services.AddEventHandlers(); 注入容器中 + + // rabbitmq 异步任务主要都在dvsv3-systemservice服务中进行处理 + // 通过app.InitApp(..,,,,onlyGlobalEvent: false) + // onlyGlobalEvent: false 处理事件 + // 通过 app.UseDistributedEventBus(onlyGlobalEvent); 中的 subscriber.Subscribe(); 消费者订阅事件 + ``` \ No newline at end of file