Ejemplo n.º 1
0
 public async Task HandleAsync(BaseIntegrationEvent @event, Type eventType, string eventName)
 {
     try
     {
         await _handler.HandleAsync((TEvent)@event, eventType, eventName);
     }
     catch (Exception e)
     {
         _logger.LogError(e, "Exception in HandleAsync");
     }
 }
Ejemplo n.º 2
0
 public async Task HandleAsync(BaseIntegrationEvent @event)
 {
     try
     {
         await _handler.HandleAsync((TEvent)@event);
     }
     catch (Exception e)
     {
         _logger.LogError(e, "Exception in HandleAsync for event with id {IntegrationEventId}", @event.Id);
     }
 }
Ejemplo n.º 3
0
 public void AddEvent(BaseIntegrationEvent @event)
 {
     if (Events == null)
     {
         Events = new List <BaseIntegrationEvent> {
             @event
         };
     }
     else
     {
         ((List <BaseIntegrationEvent>)Events).Add(@event);
     }
 }
Ejemplo n.º 4
0
        private async Task PublishCoreAsync(BaseIntegrationEvent @event)
        {
            try
            {
                await _eventStore.AddAsync(@event);

                _listener.OnNewMessage(@event.Id.ToString());
            }
            catch (Exception e)
            {
                _logger.LogError(e, "Error publishing event id: {EventId}, {@IntegrationEvent}", @event.Id, @event);
            }
        }
Ejemplo n.º 5
0
 public async Task AddAsync(BaseIntegrationEvent @event)
 {
     _db.EventOutbox.Add(@event.ToOutboxEventMessage());
     await _db.Context.SaveChangesAsync();
 }
Ejemplo n.º 6
0
 public Task PublishAsync(BaseIntegrationEvent @event) => PublishCoreAsync(@event);