From 0a8b45e09d3c594640e6d2e8e0ee8f3293c0b730 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Fri, 29 Apr 2022 10:31:30 +0800 Subject: [PATCH] Batch publish outbox events by default --- .../Abp/EventBus/Distributed/AbpEventBusBoxesOptions.cs | 6 +++--- .../Volo/Abp/EventBus/Distributed/OutboxSender.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/AbpEventBusBoxesOptions.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/AbpEventBusBoxesOptions.cs index 749aa3d6d2..d92c48db3a 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/AbpEventBusBoxesOptions.cs +++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/AbpEventBusBoxesOptions.cs @@ -36,9 +36,9 @@ public class AbpEventBusBoxesOptions public TimeSpan WaitTimeToDeleteProcessedInboxEvents { get; set; } /// - /// Default: false + /// Default: true /// - public bool OutboxPublishInBatch { get; set; } + public bool BatchPublishOutboxEvents { get; set; } public AbpEventBusBoxesOptions() { @@ -48,6 +48,6 @@ public class AbpEventBusBoxesOptions PeriodTimeSpan = TimeSpan.FromSeconds(2); DistributedLockWaitDuration = TimeSpan.FromSeconds(15); WaitTimeToDeleteProcessedInboxEvents = TimeSpan.FromHours(2); - OutboxPublishInBatch = false; + BatchPublishOutboxEvents = true; } } diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/OutboxSender.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/OutboxSender.cs index ac92740e86..851ddf3da1 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/OutboxSender.cs +++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/OutboxSender.cs @@ -86,7 +86,7 @@ public class OutboxSender : IOutboxSender, ITransientDependency Logger.LogInformation($"Found {waitingEvents.Count} events in the outbox."); - if (EventBusBoxesOptions.OutboxPublishInBatch) + if (EventBusBoxesOptions.BatchPublishOutboxEvents) { await PublishOutgoingMessagesInBatchAsync(waitingEvents); }