예제 #1
0
        public async Task PublishEventAsync(IntegrationEvent integrationEvent, CancellationToken cancellationToken)
        {
            try
            {
                await _integrationEventLogService.EventInProgressAsync(integrationEvent.Id, cancellationToken);

                _eventBus.Publish(integrationEvent);
                await _integrationEventLogService.EventPublishedAsync(integrationEvent.Id, cancellationToken);
            }
            catch
            {
                await _integrationEventLogService.EventFailedAsync(integrationEvent.Id, cancellationToken);
            }
        }