From 255e4827b4c48012f9320a1cf2b4f9bc365023b3 Mon Sep 17 00:00:00 2001 From: cKey <35512826+colinin@users.noreply.github.com> Date: Sun, 27 Dec 2020 15:25:13 +0800 Subject: [PATCH] Resolve the problem of not being able to create multiple consumers --- .../DotNetCore/CAP/ConsumerServiceSelector.cs | 27 +++++++++++-------- .../LINGYUN.Abp.EventBus.CAP.xml | 13 +-------- .../Abp/EventBus/CAP/AbpCAPEventBusOptions.cs | 5 ---- .../CAP/CustomDistributedEventSubscriber.cs | 7 +---- .../common/LINGYUN.Abp.EventBus.CAP/README.md | 8 +----- .../Distributed/TenantCreateEventHandler.cs | 2 -- .../Distributed/TenantDeleteEventHandler.cs | 2 -- .../Distributed/TenantUpdateEventHandler.cs | 2 -- .../Distributed/TenantCreateEventHandler.cs | 2 -- .../Distributed/TenantDeleteEventHandler.cs | 2 -- .../Distributed/TenantUpdateEventHandler.cs | 2 -- .../Handlers/TenantCreateEventHandler.cs | 2 -- .../Handlers/TenantCreateEventHandler.cs | 2 -- .../Handlers/TenantDeleteEventHandler.cs | 2 -- .../ApigatewayConfigChangeEventHandler.cs | 2 -- .../Distributed/ChatMessageEventHandler.cs | 2 -- .../Distributed/NotificationEventHandler.cs | 2 -- .../Distributed/TenantCreateEventHandler.cs | 2 -- .../Distributed/UserCreateEventHandler.cs | 2 -- .../EventBus/Handlers/TenantSynchronizer.cs | 2 -- 20 files changed, 19 insertions(+), 71 deletions(-) diff --git a/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/DotNetCore/CAP/ConsumerServiceSelector.cs b/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/DotNetCore/CAP/ConsumerServiceSelector.cs index 9e8b539f7..36117ae68 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/DotNetCore/CAP/ConsumerServiceSelector.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/DotNetCore/CAP/ConsumerServiceSelector.cs @@ -20,10 +20,6 @@ namespace DotNetCore.CAP public class ConsumerServiceSelector : Internal.ConsumerServiceSelector { - /// - /// Abp Cap事件配置 - /// - protected AbpCAPEventBusOptions AbpCAPEventBusOptions { get; } /// /// Abp分布式事件配置 /// @@ -38,11 +34,9 @@ namespace DotNetCore.CAP /// public ConsumerServiceSelector( IServiceProvider serviceProvider, - IOptions capEventBusOptions, IOptions distributedEventBusOptions) : base(serviceProvider) { ServiceProvider = serviceProvider; - AbpCAPEventBusOptions = capEventBusOptions.Value; AbpDistributedEventBusOptions = distributedEventBusOptions.Value; } /// @@ -69,8 +63,21 @@ namespace DotNetCore.CAP var genericArgs = @interface.GetGenericArguments(); if (genericArgs.Length == 1) { - executorDescriptorList.AddRange( - GetHandlerDescription(genericArgs[0], handler)); + var consumerExecutorDescriptors = GetHandlerDescription(genericArgs[0], handler); + + foreach (var consumerExecutorDescriptor in consumerExecutorDescriptors) + { + if (executorDescriptorList.Any(x => new ConsumerExecutorDescriptorComparer().Equals(x, consumerExecutorDescriptor))) + { + // 如果存在多个消费者,后续的消费者需要重新定义分组才能不被 CAP 框架过滤掉 + consumerExecutorDescriptor.Attribute.Group = handler.IsGenericType + ? handler.GetGenericTypeDefinition().FullName + : handler.FullName; + SetSubscribeAttribute(consumerExecutorDescriptor.Attribute); + + } + executorDescriptorList.Add(consumerExecutorDescriptor); + } //Subscribe(genericArgs[0], new IocEventHandlerFactory(ServiceScopeFactory, handler)); } } @@ -93,9 +100,7 @@ namespace DotNetCore.CAP new[] { eventType } ); // TODO: 事件名称定义在事件参数类型,就无法创建多个订阅者类了,增加可选配置,让用户决定事件名称定义在哪里 - var eventName = AbpCAPEventBusOptions.NameInEventDataType - ? EventNameAttribute.GetNameOrDefault(eventType) - : EventNameAttribute.GetNameOrDefault(typeInfo); + var eventName = EventNameAttribute.GetNameOrDefault(eventType); var topicAttr = method.GetCustomAttributes(true); var topicAttributes = topicAttr.ToList(); diff --git a/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.xml b/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.xml index ef9cf30d9..e8a019a89 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.xml +++ b/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.xml @@ -9,11 +9,6 @@ 消费者查找器 - - - Abp Cap事件配置 - - Abp分布式事件配置 @@ -24,7 +19,7 @@ 服务提供者 - + Creates a new . @@ -137,12 +132,6 @@ default: false - - - 事件名称定义在事件参数类型 - default: true - - 批量清理数量 diff --git a/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPEventBusOptions.cs b/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPEventBusOptions.cs index 36881501f..e11e7b9a9 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPEventBusOptions.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPEventBusOptions.cs @@ -11,11 +11,6 @@ /// public bool NotifyFailedCallback { get; set; } = false; /// - /// 事件名称定义在事件参数类型 - /// default: true - /// - public bool NameInEventDataType { get; set; } = true; - /// /// 批量清理数量 /// default: 1000 /// diff --git a/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/CustomDistributedEventSubscriber.cs b/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/CustomDistributedEventSubscriber.cs index 5684e9d68..b3f91337e 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/CustomDistributedEventSubscriber.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/CustomDistributedEventSubscriber.cs @@ -17,7 +17,6 @@ namespace LINGYUN.Abp.EventBus.CAP { internal class CustomDistributedEventSubscriber : ICustomDistributedEventSubscriber, ISingletonDependency { - protected AbpCAPEventBusOptions CAPEventBusOptions { get; } protected CapOptions CapOptions { get; } protected IConsumerClientFactory ConsumerClientFactory { get; } @@ -25,11 +24,9 @@ namespace LINGYUN.Abp.EventBus.CAP protected ConcurrentDictionary EventStopingTokens { get; } public CustomDistributedEventSubscriber( IOptions capOptions, - IOptions capEventBusOptions, IConsumerClientFactory consumerClientFactory) { CapOptions = capOptions.Value; - CAPEventBusOptions = capEventBusOptions.Value; ConsumerClientFactory = consumerClientFactory; HandlerFactories = new ConcurrentDictionary>(); @@ -84,9 +81,7 @@ namespace LINGYUN.Abp.EventBus.CAP nameof(IDistributedEventHandler.HandleEventAsync), new[] { eventType } ); - var eventName = CAPEventBusOptions.NameInEventDataType - ? EventNameAttribute.GetNameOrDefault(eventType) - : EventNameAttribute.GetNameOrDefault(typeInfo); + var eventName = EventNameAttribute.GetNameOrDefault(eventType); var topicAttr = method.GetCustomAttributes(true); var topicAttributes = topicAttr.ToList(); diff --git a/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/README.md b/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/README.md index 60f9bb2d7..96e725f99 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/README.md +++ b/aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/README.md @@ -6,13 +6,7 @@ * 自定义事件处理器接口 ICustomDistributedEventSubscriber 未实现,当前的分布式事件只能由 CustomDistributedEventSubscriber 在启动中发现 -* 由于Abp建议将 EventNameAttribute 标注在事件对象类,但是CAP的建议是标注在事件订阅者 EventHandler之上 - 后者有一个好处就是可以在一个启动项目中有多个订阅者消费同一个事件对象 - - 模块提供一个可选配置项,它指定了事件名称将从哪里解析 AbpCAPEventBusOptions.NameInEventDataType - 如果为 true: 事件名称将从事件对象类型中获取,比如 Volo.Abp.Users.UserEto - 如果为 false: 事件名称将从事件消费者类型中获取,比如 Volo.Abp.Users.EventBus.Handlers.UsersSynchronizer - 默认为 true,遵循Abp的文档,如果需要请自行配置为 false 来保持和 CAP 相同的习性 +* 由于 CAP 不支持同一事件参数的多个消费者,在 ConsumerServiceSelector 接口通过消费者的类全名创建一个新的Group ## 配置使用 diff --git a/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.DbFinder/LINGYUN/Abp/MultiTenancy/DbFinder/EventBus/Distributed/TenantCreateEventHandler.cs b/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.DbFinder/LINGYUN/Abp/MultiTenancy/DbFinder/EventBus/Distributed/TenantCreateEventHandler.cs index 70d01b380..bb832aa11 100644 --- a/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.DbFinder/LINGYUN/Abp/MultiTenancy/DbFinder/EventBus/Distributed/TenantCreateEventHandler.cs +++ b/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.DbFinder/LINGYUN/Abp/MultiTenancy/DbFinder/EventBus/Distributed/TenantCreateEventHandler.cs @@ -5,7 +5,6 @@ using Volo.Abp.Caching; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Entities.Events.Distributed; -using Volo.Abp.EventBus; using Volo.Abp.EventBus.Distributed; using Volo.Abp.MultiTenancy; using Volo.Abp.TenantManagement; @@ -13,7 +12,6 @@ using Volo.Abp.Uow; namespace LINGYUN.Abp.MultiTenancy.DbFinder.EventBus.Distributed { - [EventName("LINGYUN.Abp.MultiTenancy.DbFinder.Creator")] public class TenantCreateEventHandler : IDistributedEventHandler>, ITransientDependency { private readonly ILogger _logger; diff --git a/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.DbFinder/LINGYUN/Abp/MultiTenancy/DbFinder/EventBus/Distributed/TenantDeleteEventHandler.cs b/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.DbFinder/LINGYUN/Abp/MultiTenancy/DbFinder/EventBus/Distributed/TenantDeleteEventHandler.cs index b41a9a884..3d77fdad3 100644 --- a/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.DbFinder/LINGYUN/Abp/MultiTenancy/DbFinder/EventBus/Distributed/TenantDeleteEventHandler.cs +++ b/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.DbFinder/LINGYUN/Abp/MultiTenancy/DbFinder/EventBus/Distributed/TenantDeleteEventHandler.cs @@ -2,13 +2,11 @@ using Volo.Abp.Caching; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Entities.Events.Distributed; -using Volo.Abp.EventBus; using Volo.Abp.EventBus.Distributed; using Volo.Abp.TenantManagement; namespace LINGYUN.Abp.MultiTenancy.DbFinder.EventBus.Distributed { - [EventName("LINGYUN.Abp.MultiTenancy.DbFinder.Deletor")] public class TenantDeleteEventHandler : IDistributedEventHandler>, ITransientDependency { private readonly IDistributedCache _cache; diff --git a/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.DbFinder/LINGYUN/Abp/MultiTenancy/DbFinder/EventBus/Distributed/TenantUpdateEventHandler.cs b/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.DbFinder/LINGYUN/Abp/MultiTenancy/DbFinder/EventBus/Distributed/TenantUpdateEventHandler.cs index 520432a6f..86f0e7ddc 100644 --- a/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.DbFinder/LINGYUN/Abp/MultiTenancy/DbFinder/EventBus/Distributed/TenantUpdateEventHandler.cs +++ b/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.DbFinder/LINGYUN/Abp/MultiTenancy/DbFinder/EventBus/Distributed/TenantUpdateEventHandler.cs @@ -5,7 +5,6 @@ using Volo.Abp.Caching; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Entities.Events.Distributed; -using Volo.Abp.EventBus; using Volo.Abp.EventBus.Distributed; using Volo.Abp.MultiTenancy; using Volo.Abp.TenantManagement; @@ -13,7 +12,6 @@ using Volo.Abp.Uow; namespace LINGYUN.Abp.MultiTenancy.DbFinder.EventBus.Distributed { - [EventName("LINGYUN.Abp.MultiTenancy.DbFinder.Updator")] public class TenantUpdateEventHandler : IDistributedEventHandler>, ITransientDependency { private readonly ILogger _logger; diff --git a/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.RemoteService/LINGYUN/Abp/MultiTenancy/RemoteService/EventBus/Distributed/TenantCreateEventHandler.cs b/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.RemoteService/LINGYUN/Abp/MultiTenancy/RemoteService/EventBus/Distributed/TenantCreateEventHandler.cs index 701cc7214..8b29c7971 100644 --- a/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.RemoteService/LINGYUN/Abp/MultiTenancy/RemoteService/EventBus/Distributed/TenantCreateEventHandler.cs +++ b/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.RemoteService/LINGYUN/Abp/MultiTenancy/RemoteService/EventBus/Distributed/TenantCreateEventHandler.cs @@ -4,13 +4,11 @@ using Volo.Abp.Caching; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Entities.Events.Distributed; -using Volo.Abp.EventBus; using Volo.Abp.EventBus.Distributed; using Volo.Abp.TenantManagement; namespace LINGYUN.Abp.MultiTenancy.RemoteService.EventBus.Distributed { - [EventName("LINGYUN.Abp.MultiTenancy.RemoteService.Creator")] public class TenantCreateEventHandler : IDistributedEventHandler>, ITransientDependency { private readonly ITenantAppService _tenantAppService; diff --git a/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.RemoteService/LINGYUN/Abp/MultiTenancy/RemoteService/EventBus/Distributed/TenantDeleteEventHandler.cs b/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.RemoteService/LINGYUN/Abp/MultiTenancy/RemoteService/EventBus/Distributed/TenantDeleteEventHandler.cs index 304cfb771..0edee7cfc 100644 --- a/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.RemoteService/LINGYUN/Abp/MultiTenancy/RemoteService/EventBus/Distributed/TenantDeleteEventHandler.cs +++ b/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.RemoteService/LINGYUN/Abp/MultiTenancy/RemoteService/EventBus/Distributed/TenantDeleteEventHandler.cs @@ -2,13 +2,11 @@ using Volo.Abp.Caching; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Entities.Events.Distributed; -using Volo.Abp.EventBus; using Volo.Abp.EventBus.Distributed; using Volo.Abp.TenantManagement; namespace LINGYUN.Abp.MultiTenancy.RemoteService.EventBus.Distributed { - [EventName("LINGYUN.Abp.MultiTenancy.RemoteService.Deletor")] public class TenantDeleteEventHandler : IDistributedEventHandler>, ITransientDependency { private readonly IDistributedCache _cache; diff --git a/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.RemoteService/LINGYUN/Abp/MultiTenancy/RemoteService/EventBus/Distributed/TenantUpdateEventHandler.cs b/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.RemoteService/LINGYUN/Abp/MultiTenancy/RemoteService/EventBus/Distributed/TenantUpdateEventHandler.cs index 93023b904..2a052b0f0 100644 --- a/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.RemoteService/LINGYUN/Abp/MultiTenancy/RemoteService/EventBus/Distributed/TenantUpdateEventHandler.cs +++ b/aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.RemoteService/LINGYUN/Abp/MultiTenancy/RemoteService/EventBus/Distributed/TenantUpdateEventHandler.cs @@ -4,13 +4,11 @@ using Volo.Abp.Caching; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Entities.Events.Distributed; -using Volo.Abp.EventBus; using Volo.Abp.EventBus.Distributed; using Volo.Abp.TenantManagement; namespace LINGYUN.Abp.MultiTenancy.RemoteService.EventBus.Distributed { - [EventName("LINGYUN.Abp.MultiTenancy.RemoteService.Updator")] public class TenantUpdateEventHandler : IDistributedEventHandler>, ITransientDependency { private readonly ITenantAppService _tenantAppService; diff --git a/aspnet-core/services/account/AuthServer.Host/EventBus/Handlers/TenantCreateEventHandler.cs b/aspnet-core/services/account/AuthServer.Host/EventBus/Handlers/TenantCreateEventHandler.cs index f66107ce8..f1ef512c2 100644 --- a/aspnet-core/services/account/AuthServer.Host/EventBus/Handlers/TenantCreateEventHandler.cs +++ b/aspnet-core/services/account/AuthServer.Host/EventBus/Handlers/TenantCreateEventHandler.cs @@ -4,7 +4,6 @@ using Microsoft.Extensions.Logging; using System; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -using Volo.Abp.EventBus; using Volo.Abp.EventBus.Distributed; using Volo.Abp.Guids; using Volo.Abp.Identity; @@ -15,7 +14,6 @@ using IdentityUser = Volo.Abp.Identity.IdentityUser; namespace AuthServer.Host.EventBus.Handlers { - [EventName("LINGYUN.Abp.Tenants.Admin.UserRoles.Creator")] public class TenantCreateEventHandler : IDistributedEventHandler, ITransientDependency { protected ILogger Logger { get; } diff --git a/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/EventBus/Handlers/TenantCreateEventHandler.cs b/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/EventBus/Handlers/TenantCreateEventHandler.cs index cb4a3dfab..4114471d0 100644 --- a/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/EventBus/Handlers/TenantCreateEventHandler.cs +++ b/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/EventBus/Handlers/TenantCreateEventHandler.cs @@ -7,7 +7,6 @@ using System.Threading.Tasks; using Volo.Abp.Authorization.Permissions; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories; -using Volo.Abp.EventBus; using Volo.Abp.EventBus.Distributed; using Volo.Abp.Guids; using Volo.Abp.MultiTenancy; @@ -16,7 +15,6 @@ using Volo.Abp.Uow; namespace LINGYUN.Abp.BackendAdmin.EventBus.Handlers { - [EventName("LINGYUN.Abp.Tenants.Admin.Permissions.Creator")] public class TenantCreateEventHandler : IDistributedEventHandler, ITransientDependency { protected ICurrentTenant CurrentTenant { get; } diff --git a/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/EventBus/Handlers/TenantDeleteEventHandler.cs b/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/EventBus/Handlers/TenantDeleteEventHandler.cs index 35660b2dc..3a120c7f1 100644 --- a/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/EventBus/Handlers/TenantDeleteEventHandler.cs +++ b/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/EventBus/Handlers/TenantDeleteEventHandler.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Domain.Repositories; -using Volo.Abp.EventBus; using Volo.Abp.EventBus.Distributed; using Volo.Abp.Guids; using Volo.Abp.MultiTenancy; @@ -15,7 +14,6 @@ using Volo.Abp.Uow; namespace LINGYUN.Abp.BackendAdmin.EventBus.Handlers { - [EventName("LINGYUN.Abp.Tenants.Admin.Permissions.Deletor")] public class TenantDeleteEventHandler : IDistributedEventHandler>, ITransientDependency { protected ICurrentTenant CurrentTenant { get; } diff --git a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/EventBus/ApigatewayConfigChangeEventHandler.cs b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/EventBus/ApigatewayConfigChangeEventHandler.cs index 9892e9489..63b3513b6 100644 --- a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/EventBus/ApigatewayConfigChangeEventHandler.cs +++ b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/EventBus/ApigatewayConfigChangeEventHandler.cs @@ -5,12 +5,10 @@ using Ocelot.Configuration.Repository; using System.Linq; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -using Volo.Abp.EventBus; using Volo.Abp.EventBus.Distributed; namespace LINGYUN.ApiGateway.EventBus { - [EventName("LINGYUN.ApiGateway.ConfigChanged")] public class ApigatewayConfigChangeEventHandler : IDistributedEventHandler, ITransientDependency { protected ApiGatewayOptions Options { get; } diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/ChatMessageEventHandler.cs b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/ChatMessageEventHandler.cs index 7178bd379..eeafa90a0 100644 --- a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/ChatMessageEventHandler.cs +++ b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/ChatMessageEventHandler.cs @@ -5,12 +5,10 @@ using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -using Volo.Abp.EventBus; using Volo.Abp.EventBus.Distributed; namespace LINGYUN.Abp.MessageService.EventBus.Distributed { - [EventName("LINGYUN.Abp.MessageService.ChatMessage.Sender")] public class ChatMessageEventHandler : IDistributedEventHandler, ITransientDependency { /// diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/NotificationEventHandler.cs b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/NotificationEventHandler.cs index d5315d6c5..42c217b7e 100644 --- a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/NotificationEventHandler.cs +++ b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/NotificationEventHandler.cs @@ -9,7 +9,6 @@ using System.Linq; using System.Threading.Tasks; using Volo.Abp.BackgroundJobs; using Volo.Abp.DependencyInjection; -using Volo.Abp.EventBus; using Volo.Abp.EventBus.Distributed; using Volo.Abp.Json; using Volo.Abp.Uow; @@ -23,7 +22,6 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed /// 作用在于SignalR客户端只会与一台服务器建立连接, /// 只有启用了SignlR服务端的才能真正将消息发布到客户端 /// - [EventName("LINGYUN.Abp.MessageService.Notifications.Sender")] public class NotificationEventHandler : IDistributedEventHandler, ITransientDependency { /// diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/TenantCreateEventHandler.cs b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/TenantCreateEventHandler.cs index 7cf64e91c..ec1fa8927 100644 --- a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/TenantCreateEventHandler.cs +++ b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/TenantCreateEventHandler.cs @@ -7,7 +7,6 @@ using System; using System.Globalization; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -using Volo.Abp.EventBus; using Volo.Abp.EventBus.Distributed; using Volo.Abp.Localization; using Volo.Abp.MultiTenancy; @@ -15,7 +14,6 @@ using Volo.Abp.Settings; namespace LINGYUN.Abp.MessageService.EventBus.Distributed { - [EventName("LINGYUN.Abp.Tenants.MessageService.Creator")] public class TenantCreateEventHandler : IDistributedEventHandler, ITransientDependency { protected ILogger Logger { get; } diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/UserCreateEventHandler.cs b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/UserCreateEventHandler.cs index d541811fc..2b7bbcdf4 100644 --- a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/UserCreateEventHandler.cs +++ b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/UserCreateEventHandler.cs @@ -2,14 +2,12 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Entities.Events; using Volo.Abp.Domain.Entities.Events.Distributed; -using Volo.Abp.EventBus; using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Local; using Volo.Abp.Users; namespace LINGYUN.Abp.MessageService.EventBus.Distributed { - [EventName("LINGYUN.Abp.Users.MessageService.Creator")] public class UserCreateEventHandler : IDistributedEventHandler>, ITransientDependency { private readonly ILocalEventBus _localEventBus; diff --git a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EventBus/Handlers/TenantSynchronizer.cs b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EventBus/Handlers/TenantSynchronizer.cs index 74401acaa..32d60ac56 100644 --- a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EventBus/Handlers/TenantSynchronizer.cs +++ b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EventBus/Handlers/TenantSynchronizer.cs @@ -9,14 +9,12 @@ using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; -using Volo.Abp.EventBus; using Volo.Abp.EventBus.Distributed; using Volo.Abp.Guids; using Volo.Abp.MultiTenancy; namespace LINGYUN.Platform.EventBus.Handlers { - [EventName("LINGYUN.Abp.Tenants.Platform.Creator")] public class TenantSynchronizer : IDistributedEventHandler, ITransientDependency