protected virtual async Task PublishOutgoingMessagesInBatchAsync(List <OutgoingEventInfo> waitingEvents) { await DistributedEventBus .AsSupportsEventBoxes() .PublishManyFromOutboxAsync(waitingEvents, OutboxConfig); await Outbox.DeleteManyAsync(waitingEvents.Select(x => x.Id).ToArray()); Logger.LogInformation($"Sent {waitingEvents.Count} events to message broker"); }