Browse Source

Resolve the problem of not being able to create multiple consumers

pull/173/head
cKey 5 years ago
parent
commit
255e4827b4
  1. 27
      aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/DotNetCore/CAP/ConsumerServiceSelector.cs
  2. 13
      aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.xml
  3. 5
      aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPEventBusOptions.cs
  4. 7
      aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/CustomDistributedEventSubscriber.cs
  5. 8
      aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/README.md
  6. 2
      aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.DbFinder/LINGYUN/Abp/MultiTenancy/DbFinder/EventBus/Distributed/TenantCreateEventHandler.cs
  7. 2
      aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.DbFinder/LINGYUN/Abp/MultiTenancy/DbFinder/EventBus/Distributed/TenantDeleteEventHandler.cs
  8. 2
      aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.DbFinder/LINGYUN/Abp/MultiTenancy/DbFinder/EventBus/Distributed/TenantUpdateEventHandler.cs
  9. 2
      aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.RemoteService/LINGYUN/Abp/MultiTenancy/RemoteService/EventBus/Distributed/TenantCreateEventHandler.cs
  10. 2
      aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.RemoteService/LINGYUN/Abp/MultiTenancy/RemoteService/EventBus/Distributed/TenantDeleteEventHandler.cs
  11. 2
      aspnet-core/modules/tenants/LINGYUN.Abp.MultiTenancy.RemoteService/LINGYUN/Abp/MultiTenancy/RemoteService/EventBus/Distributed/TenantUpdateEventHandler.cs
  12. 2
      aspnet-core/services/account/AuthServer.Host/EventBus/Handlers/TenantCreateEventHandler.cs
  13. 2
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/EventBus/Handlers/TenantCreateEventHandler.cs
  14. 2
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/EventBus/Handlers/TenantDeleteEventHandler.cs
  15. 2
      aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/EventBus/ApigatewayConfigChangeEventHandler.cs
  16. 2
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/ChatMessageEventHandler.cs
  17. 2
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/NotificationEventHandler.cs
  18. 2
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/TenantCreateEventHandler.cs
  19. 2
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/UserCreateEventHandler.cs
  20. 2
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EventBus/Handlers/TenantSynchronizer.cs

27
aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/DotNetCore/CAP/ConsumerServiceSelector.cs

@ -20,10 +20,6 @@ namespace DotNetCore.CAP
public class ConsumerServiceSelector : Internal.ConsumerServiceSelector public class ConsumerServiceSelector : Internal.ConsumerServiceSelector
{ {
/// <summary>
/// Abp Cap事件配置
/// </summary>
protected AbpCAPEventBusOptions AbpCAPEventBusOptions { get; }
/// <summary> /// <summary>
/// Abp分布式事件配置 /// Abp分布式事件配置
/// </summary> /// </summary>
@ -38,11 +34,9 @@ namespace DotNetCore.CAP
/// </summary> /// </summary>
public ConsumerServiceSelector( public ConsumerServiceSelector(
IServiceProvider serviceProvider, IServiceProvider serviceProvider,
IOptions<AbpCAPEventBusOptions> capEventBusOptions,
IOptions<AbpDistributedEventBusOptions> distributedEventBusOptions) : base(serviceProvider) IOptions<AbpDistributedEventBusOptions> distributedEventBusOptions) : base(serviceProvider)
{ {
ServiceProvider = serviceProvider; ServiceProvider = serviceProvider;
AbpCAPEventBusOptions = capEventBusOptions.Value;
AbpDistributedEventBusOptions = distributedEventBusOptions.Value; AbpDistributedEventBusOptions = distributedEventBusOptions.Value;
} }
/// <summary> /// <summary>
@ -69,8 +63,21 @@ namespace DotNetCore.CAP
var genericArgs = @interface.GetGenericArguments(); var genericArgs = @interface.GetGenericArguments();
if (genericArgs.Length == 1) if (genericArgs.Length == 1)
{ {
executorDescriptorList.AddRange( var consumerExecutorDescriptors = GetHandlerDescription(genericArgs[0], handler);
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)); //Subscribe(genericArgs[0], new IocEventHandlerFactory(ServiceScopeFactory, handler));
} }
} }
@ -93,9 +100,7 @@ namespace DotNetCore.CAP
new[] { eventType } new[] { eventType }
); );
// TODO: 事件名称定义在事件参数类型,就无法创建多个订阅者类了,增加可选配置,让用户决定事件名称定义在哪里 // TODO: 事件名称定义在事件参数类型,就无法创建多个订阅者类了,增加可选配置,让用户决定事件名称定义在哪里
var eventName = AbpCAPEventBusOptions.NameInEventDataType var eventName = EventNameAttribute.GetNameOrDefault(eventType);
? EventNameAttribute.GetNameOrDefault(eventType)
: EventNameAttribute.GetNameOrDefault(typeInfo);
var topicAttr = method.GetCustomAttributes<TopicAttribute>(true); var topicAttr = method.GetCustomAttributes<TopicAttribute>(true);
var topicAttributes = topicAttr.ToList(); var topicAttributes = topicAttr.ToList();

13
aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.xml

@ -9,11 +9,6 @@
消费者查找器 消费者查找器
</summary> </summary>
</member> </member>
<member name="P:DotNetCore.CAP.ConsumerServiceSelector.AbpCAPEventBusOptions">
<summary>
Abp Cap事件配置
</summary>
</member>
<member name="P:DotNetCore.CAP.ConsumerServiceSelector.AbpDistributedEventBusOptions"> <member name="P:DotNetCore.CAP.ConsumerServiceSelector.AbpDistributedEventBusOptions">
<summary> <summary>
Abp分布式事件配置 Abp分布式事件配置
@ -24,7 +19,7 @@
服务提供者 服务提供者
</summary> </summary>
</member> </member>
<member name="M:DotNetCore.CAP.ConsumerServiceSelector.#ctor(System.IServiceProvider,Microsoft.Extensions.Options.IOptions{LINGYUN.Abp.EventBus.CAP.AbpCAPEventBusOptions},Microsoft.Extensions.Options.IOptions{Volo.Abp.EventBus.Distributed.AbpDistributedEventBusOptions})"> <member name="M:DotNetCore.CAP.ConsumerServiceSelector.#ctor(System.IServiceProvider,Microsoft.Extensions.Options.IOptions{Volo.Abp.EventBus.Distributed.AbpDistributedEventBusOptions})">
<summary> <summary>
Creates a new <see cref="T:DotNetCore.CAP.Internal.ConsumerServiceSelector" />. Creates a new <see cref="T:DotNetCore.CAP.Internal.ConsumerServiceSelector" />.
</summary> </summary>
@ -137,12 +132,6 @@
default: false default: false
</summary> </summary>
</member> </member>
<member name="P:LINGYUN.Abp.EventBus.CAP.AbpCAPEventBusOptions.NameInEventDataType">
<summary>
事件名称定义在事件参数类型
default: true
</summary>
</member>
<member name="P:LINGYUN.Abp.EventBus.CAP.AbpCAPEventBusOptions.CleanUpExpiresMessageBatch"> <member name="P:LINGYUN.Abp.EventBus.CAP.AbpCAPEventBusOptions.CleanUpExpiresMessageBatch">
<summary> <summary>
批量清理数量 批量清理数量

5
aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPEventBusOptions.cs

@ -11,11 +11,6 @@
/// </summary> /// </summary>
public bool NotifyFailedCallback { get; set; } = false; public bool NotifyFailedCallback { get; set; } = false;
/// <summary> /// <summary>
/// 事件名称定义在事件参数类型
/// default: true
/// </summary>
public bool NameInEventDataType { get; set; } = true;
/// <summary>
/// 批量清理数量 /// 批量清理数量
/// default: 1000 /// default: 1000
/// </summary> /// </summary>

7
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 internal class CustomDistributedEventSubscriber : ICustomDistributedEventSubscriber, ISingletonDependency
{ {
protected AbpCAPEventBusOptions CAPEventBusOptions { get; }
protected CapOptions CapOptions { get; } protected CapOptions CapOptions { get; }
protected IConsumerClientFactory ConsumerClientFactory { get; } protected IConsumerClientFactory ConsumerClientFactory { get; }
@ -25,11 +24,9 @@ namespace LINGYUN.Abp.EventBus.CAP
protected ConcurrentDictionary<string, CancellationTokenSource> EventStopingTokens { get; } protected ConcurrentDictionary<string, CancellationTokenSource> EventStopingTokens { get; }
public CustomDistributedEventSubscriber( public CustomDistributedEventSubscriber(
IOptions<CapOptions> capOptions, IOptions<CapOptions> capOptions,
IOptions<AbpCAPEventBusOptions> capEventBusOptions,
IConsumerClientFactory consumerClientFactory) IConsumerClientFactory consumerClientFactory)
{ {
CapOptions = capOptions.Value; CapOptions = capOptions.Value;
CAPEventBusOptions = capEventBusOptions.Value;
ConsumerClientFactory = consumerClientFactory; ConsumerClientFactory = consumerClientFactory;
HandlerFactories = new ConcurrentDictionary<Type, List<IEventHandlerFactory>>(); HandlerFactories = new ConcurrentDictionary<Type, List<IEventHandlerFactory>>();
@ -84,9 +81,7 @@ namespace LINGYUN.Abp.EventBus.CAP
nameof(IDistributedEventHandler<object>.HandleEventAsync), nameof(IDistributedEventHandler<object>.HandleEventAsync),
new[] { eventType } new[] { eventType }
); );
var eventName = CAPEventBusOptions.NameInEventDataType var eventName = EventNameAttribute.GetNameOrDefault(eventType);
? EventNameAttribute.GetNameOrDefault(eventType)
: EventNameAttribute.GetNameOrDefault(typeInfo);
var topicAttr = method.GetCustomAttributes<TopicAttribute>(true); var topicAttr = method.GetCustomAttributes<TopicAttribute>(true);
var topicAttributes = topicAttr.ToList(); var topicAttributes = topicAttr.ToList();

8
aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/README.md

@ -6,13 +6,7 @@
* 自定义事件处理器接口 ICustomDistributedEventSubscriber 未实现,当前的分布式事件只能由 CustomDistributedEventSubscriber 在启动中发现 * 自定义事件处理器接口 ICustomDistributedEventSubscriber 未实现,当前的分布式事件只能由 CustomDistributedEventSubscriber 在启动中发现
* 由于Abp建议将 EventNameAttribute 标注在事件对象类,但是CAP的建议是标注在事件订阅者 EventHandler之上 * 由于 CAP 不支持同一事件参数的多个消费者,在 ConsumerServiceSelector 接口通过消费者的类全名创建一个新的Group
后者有一个好处就是可以在一个启动项目中有多个订阅者消费同一个事件对象
模块提供一个可选配置项,它指定了事件名称将从哪里解析 AbpCAPEventBusOptions.NameInEventDataType
如果为 true: 事件名称将从事件对象类型中获取,比如 Volo.Abp.Users.UserEto
如果为 false: 事件名称将从事件消费者类型中获取,比如 Volo.Abp.Users.EventBus.Handlers.UsersSynchronizer
默认为 true,遵循Abp的文档,如果需要请自行配置为 false 来保持和 CAP 相同的习性
## 配置使用 ## 配置使用

2
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.Data;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus;
using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Distributed;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
using Volo.Abp.TenantManagement; using Volo.Abp.TenantManagement;
@ -13,7 +12,6 @@ using Volo.Abp.Uow;
namespace LINGYUN.Abp.MultiTenancy.DbFinder.EventBus.Distributed namespace LINGYUN.Abp.MultiTenancy.DbFinder.EventBus.Distributed
{ {
[EventName("LINGYUN.Abp.MultiTenancy.DbFinder.Creator")]
public class TenantCreateEventHandler : IDistributedEventHandler<EntityCreatedEto<TenantEto>>, ITransientDependency public class TenantCreateEventHandler : IDistributedEventHandler<EntityCreatedEto<TenantEto>>, ITransientDependency
{ {
private readonly ILogger<TenantCreateEventHandler> _logger; private readonly ILogger<TenantCreateEventHandler> _logger;

2
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.Caching;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus;
using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Distributed;
using Volo.Abp.TenantManagement; using Volo.Abp.TenantManagement;
namespace LINGYUN.Abp.MultiTenancy.DbFinder.EventBus.Distributed namespace LINGYUN.Abp.MultiTenancy.DbFinder.EventBus.Distributed
{ {
[EventName("LINGYUN.Abp.MultiTenancy.DbFinder.Deletor")]
public class TenantDeleteEventHandler : IDistributedEventHandler<EntityDeletedEto<TenantEto>>, ITransientDependency public class TenantDeleteEventHandler : IDistributedEventHandler<EntityDeletedEto<TenantEto>>, ITransientDependency
{ {
private readonly IDistributedCache<TenantConfigurationCacheItem> _cache; private readonly IDistributedCache<TenantConfigurationCacheItem> _cache;

2
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.Data;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus;
using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Distributed;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
using Volo.Abp.TenantManagement; using Volo.Abp.TenantManagement;
@ -13,7 +12,6 @@ using Volo.Abp.Uow;
namespace LINGYUN.Abp.MultiTenancy.DbFinder.EventBus.Distributed namespace LINGYUN.Abp.MultiTenancy.DbFinder.EventBus.Distributed
{ {
[EventName("LINGYUN.Abp.MultiTenancy.DbFinder.Updator")]
public class TenantUpdateEventHandler : IDistributedEventHandler<EntityUpdatedEto<TenantEto>>, ITransientDependency public class TenantUpdateEventHandler : IDistributedEventHandler<EntityUpdatedEto<TenantEto>>, ITransientDependency
{ {
private readonly ILogger<TenantUpdateEventHandler> _logger; private readonly ILogger<TenantUpdateEventHandler> _logger;

2
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.Data;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus;
using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Distributed;
using Volo.Abp.TenantManagement; using Volo.Abp.TenantManagement;
namespace LINGYUN.Abp.MultiTenancy.RemoteService.EventBus.Distributed namespace LINGYUN.Abp.MultiTenancy.RemoteService.EventBus.Distributed
{ {
[EventName("LINGYUN.Abp.MultiTenancy.RemoteService.Creator")]
public class TenantCreateEventHandler : IDistributedEventHandler<EntityCreatedEto<TenantEto>>, ITransientDependency public class TenantCreateEventHandler : IDistributedEventHandler<EntityCreatedEto<TenantEto>>, ITransientDependency
{ {
private readonly ITenantAppService _tenantAppService; private readonly ITenantAppService _tenantAppService;

2
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.Caching;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus;
using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Distributed;
using Volo.Abp.TenantManagement; using Volo.Abp.TenantManagement;
namespace LINGYUN.Abp.MultiTenancy.RemoteService.EventBus.Distributed namespace LINGYUN.Abp.MultiTenancy.RemoteService.EventBus.Distributed
{ {
[EventName("LINGYUN.Abp.MultiTenancy.RemoteService.Deletor")]
public class TenantDeleteEventHandler : IDistributedEventHandler<EntityDeletedEto<TenantEto>>, ITransientDependency public class TenantDeleteEventHandler : IDistributedEventHandler<EntityDeletedEto<TenantEto>>, ITransientDependency
{ {
private readonly IDistributedCache<TenantConfigurationCacheItem> _cache; private readonly IDistributedCache<TenantConfigurationCacheItem> _cache;

2
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.Data;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus;
using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Distributed;
using Volo.Abp.TenantManagement; using Volo.Abp.TenantManagement;
namespace LINGYUN.Abp.MultiTenancy.RemoteService.EventBus.Distributed namespace LINGYUN.Abp.MultiTenancy.RemoteService.EventBus.Distributed
{ {
[EventName("LINGYUN.Abp.MultiTenancy.RemoteService.Updator")]
public class TenantUpdateEventHandler : IDistributedEventHandler<EntityUpdatedEto<TenantEto>>, ITransientDependency public class TenantUpdateEventHandler : IDistributedEventHandler<EntityUpdatedEto<TenantEto>>, ITransientDependency
{ {
private readonly ITenantAppService _tenantAppService; private readonly ITenantAppService _tenantAppService;

2
aspnet-core/services/account/AuthServer.Host/EventBus/Handlers/TenantCreateEventHandler.cs

@ -4,7 +4,6 @@ using Microsoft.Extensions.Logging;
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus;
using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Guids; using Volo.Abp.Guids;
using Volo.Abp.Identity; using Volo.Abp.Identity;
@ -15,7 +14,6 @@ using IdentityUser = Volo.Abp.Identity.IdentityUser;
namespace AuthServer.Host.EventBus.Handlers namespace AuthServer.Host.EventBus.Handlers
{ {
[EventName("LINGYUN.Abp.Tenants.Admin.UserRoles.Creator")]
public class TenantCreateEventHandler : IDistributedEventHandler<CreateEventData>, ITransientDependency public class TenantCreateEventHandler : IDistributedEventHandler<CreateEventData>, ITransientDependency
{ {
protected ILogger<TenantCreateEventHandler> Logger { get; } protected ILogger<TenantCreateEventHandler> Logger { get; }

2
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.Authorization.Permissions;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
using Volo.Abp.EventBus;
using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Guids; using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
@ -16,7 +15,6 @@ using Volo.Abp.Uow;
namespace LINGYUN.Abp.BackendAdmin.EventBus.Handlers namespace LINGYUN.Abp.BackendAdmin.EventBus.Handlers
{ {
[EventName("LINGYUN.Abp.Tenants.Admin.Permissions.Creator")]
public class TenantCreateEventHandler : IDistributedEventHandler<CreateEventData>, ITransientDependency public class TenantCreateEventHandler : IDistributedEventHandler<CreateEventData>, ITransientDependency
{ {
protected ICurrentTenant CurrentTenant { get; } protected ICurrentTenant CurrentTenant { get; }

2
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.DependencyInjection;
using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
using Volo.Abp.EventBus;
using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Guids; using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
@ -15,7 +14,6 @@ using Volo.Abp.Uow;
namespace LINGYUN.Abp.BackendAdmin.EventBus.Handlers namespace LINGYUN.Abp.BackendAdmin.EventBus.Handlers
{ {
[EventName("LINGYUN.Abp.Tenants.Admin.Permissions.Deletor")]
public class TenantDeleteEventHandler : IDistributedEventHandler<EntityDeletedEto<TenantEto>>, ITransientDependency public class TenantDeleteEventHandler : IDistributedEventHandler<EntityDeletedEto<TenantEto>>, ITransientDependency
{ {
protected ICurrentTenant CurrentTenant { get; } protected ICurrentTenant CurrentTenant { get; }

2
aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/EventBus/ApigatewayConfigChangeEventHandler.cs

@ -5,12 +5,10 @@ using Ocelot.Configuration.Repository;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus;
using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Distributed;
namespace LINGYUN.ApiGateway.EventBus namespace LINGYUN.ApiGateway.EventBus
{ {
[EventName("LINGYUN.ApiGateway.ConfigChanged")]
public class ApigatewayConfigChangeEventHandler : IDistributedEventHandler<ApigatewayConfigChangeEventData>, ITransientDependency public class ApigatewayConfigChangeEventHandler : IDistributedEventHandler<ApigatewayConfigChangeEventData>, ITransientDependency
{ {
protected ApiGatewayOptions Options { get; } protected ApiGatewayOptions Options { get; }

2
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 Microsoft.Extensions.Options;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus;
using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Distributed;
namespace LINGYUN.Abp.MessageService.EventBus.Distributed namespace LINGYUN.Abp.MessageService.EventBus.Distributed
{ {
[EventName("LINGYUN.Abp.MessageService.ChatMessage.Sender")]
public class ChatMessageEventHandler : IDistributedEventHandler<ChatMessage>, ITransientDependency public class ChatMessageEventHandler : IDistributedEventHandler<ChatMessage>, ITransientDependency
{ {
/// <summary> /// <summary>

2
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 System.Threading.Tasks;
using Volo.Abp.BackgroundJobs; using Volo.Abp.BackgroundJobs;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus;
using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Json; using Volo.Abp.Json;
using Volo.Abp.Uow; using Volo.Abp.Uow;
@ -23,7 +22,6 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed
/// 作用在于SignalR客户端只会与一台服务器建立连接, /// 作用在于SignalR客户端只会与一台服务器建立连接,
/// 只有启用了SignlR服务端的才能真正将消息发布到客户端 /// 只有启用了SignlR服务端的才能真正将消息发布到客户端
/// </remarks> /// </remarks>
[EventName("LINGYUN.Abp.MessageService.Notifications.Sender")]
public class NotificationEventHandler : IDistributedEventHandler<NotificationEventData>, ITransientDependency public class NotificationEventHandler : IDistributedEventHandler<NotificationEventData>, ITransientDependency
{ {
/// <summary> /// <summary>

2
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/TenantCreateEventHandler.cs

@ -7,7 +7,6 @@ using System;
using System.Globalization; using System.Globalization;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus;
using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Localization; using Volo.Abp.Localization;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
@ -15,7 +14,6 @@ using Volo.Abp.Settings;
namespace LINGYUN.Abp.MessageService.EventBus.Distributed namespace LINGYUN.Abp.MessageService.EventBus.Distributed
{ {
[EventName("LINGYUN.Abp.Tenants.MessageService.Creator")]
public class TenantCreateEventHandler : IDistributedEventHandler<CreateEventData>, ITransientDependency public class TenantCreateEventHandler : IDistributedEventHandler<CreateEventData>, ITransientDependency
{ {
protected ILogger<TenantCreateEventHandler> Logger { get; } protected ILogger<TenantCreateEventHandler> Logger { get; }

2
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/UserCreateEventHandler.cs

@ -2,14 +2,12 @@
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events; using Volo.Abp.Domain.Entities.Events;
using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus;
using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Distributed;
using Volo.Abp.EventBus.Local; using Volo.Abp.EventBus.Local;
using Volo.Abp.Users; using Volo.Abp.Users;
namespace LINGYUN.Abp.MessageService.EventBus.Distributed namespace LINGYUN.Abp.MessageService.EventBus.Distributed
{ {
[EventName("LINGYUN.Abp.Users.MessageService.Creator")]
public class UserCreateEventHandler : IDistributedEventHandler<EntityCreatedEto<UserEto>>, ITransientDependency public class UserCreateEventHandler : IDistributedEventHandler<EntityCreatedEto<UserEto>>, ITransientDependency
{ {
private readonly ILocalEventBus _localEventBus; private readonly ILocalEventBus _localEventBus;

2
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 System.Threading.Tasks;
using Volo.Abp.Data; using Volo.Abp.Data;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus;
using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Guids; using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
namespace LINGYUN.Platform.EventBus.Handlers namespace LINGYUN.Platform.EventBus.Handlers
{ {
[EventName("LINGYUN.Abp.Tenants.Platform.Creator")]
public class TenantSynchronizer : public class TenantSynchronizer :
IDistributedEventHandler<CreateEventData>, IDistributedEventHandler<CreateEventData>,
ITransientDependency ITransientDependency

Loading…
Cancel
Save