Browse Source

Batch publish outbox events by default

pull/11243/head
liangshiwei 4 years ago
parent
commit
0a8b45e09d
  1. 6
      framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/AbpEventBusBoxesOptions.cs
  2. 2
      framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/OutboxSender.cs

6
framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/AbpEventBusBoxesOptions.cs

@ -36,9 +36,9 @@ public class AbpEventBusBoxesOptions
public TimeSpan WaitTimeToDeleteProcessedInboxEvents { get; set; } public TimeSpan WaitTimeToDeleteProcessedInboxEvents { get; set; }
/// <summary> /// <summary>
/// Default: false /// Default: true
/// </summary> /// </summary>
public bool OutboxPublishInBatch { get; set; } public bool BatchPublishOutboxEvents { get; set; }
public AbpEventBusBoxesOptions() public AbpEventBusBoxesOptions()
{ {
@ -48,6 +48,6 @@ public class AbpEventBusBoxesOptions
PeriodTimeSpan = TimeSpan.FromSeconds(2); PeriodTimeSpan = TimeSpan.FromSeconds(2);
DistributedLockWaitDuration = TimeSpan.FromSeconds(15); DistributedLockWaitDuration = TimeSpan.FromSeconds(15);
WaitTimeToDeleteProcessedInboxEvents = TimeSpan.FromHours(2); WaitTimeToDeleteProcessedInboxEvents = TimeSpan.FromHours(2);
OutboxPublishInBatch = false; BatchPublishOutboxEvents = true;
} }
} }

2
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."); Logger.LogInformation($"Found {waitingEvents.Count} events in the outbox.");
if (EventBusBoxesOptions.OutboxPublishInBatch) if (EventBusBoxesOptions.BatchPublishOutboxEvents)
{ {
await PublishOutgoingMessagesInBatchAsync(waitingEvents); await PublishOutgoingMessagesInBatchAsync(waitingEvents);
} }

Loading…
Cancel
Save