From 12fafaa8bb251056829c70a79f85dcefb111b0cf Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Wed, 1 Jun 2022 22:10:01 +0800 Subject: [PATCH] Using the event boxes orderly Resolve #12851 --- .../Volo/Abp/EventBus/Distributed/DistributedEventBusBase.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusBase.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusBase.cs index 69ae91505d..5da66e03cd 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusBase.cs +++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusBase.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; @@ -102,7 +103,7 @@ public abstract class DistributedEventBusBase : EventBusBase, IDistributedEventB return false; } - foreach (var outboxConfig in AbpDistributedEventBusOptions.Outboxes.Values) + foreach (var outboxConfig in AbpDistributedEventBusOptions.Outboxes.Values.OrderBy(x => x.Selector is null)) { if (outboxConfig.Selector == null || outboxConfig.Selector(eventType)) { @@ -137,7 +138,7 @@ public abstract class DistributedEventBusBase : EventBusBase, IDistributedEventB using (var scope = ServiceScopeFactory.CreateScope()) { - foreach (var inboxConfig in AbpDistributedEventBusOptions.Inboxes.Values) + foreach (var inboxConfig in AbpDistributedEventBusOptions.Inboxes.Values.OrderBy(x => x.EventSelector is null)) { if (inboxConfig.EventSelector == null || inboxConfig.EventSelector(eventType)) {