public virtual async Task EnqueueAsync(OutgoingEventInfo outgoingEvent) { var dbContext = (IHasEventOutbox)await DbContextProvider.GetDbContextAsync(); dbContext.OutgoingEvents.Add( new OutgoingEventRecord(outgoingEvent) ); }
public override Task PublishFromOutboxAsync( OutgoingEventInfo outgoingEvent, OutboxConfig outboxConfig) { var eventType = EventTypes.GetOrDefault(outgoingEvent.EventName); var eventData = Serializer.Deserialize(outgoingEvent.EventData, eventType); return(PublishToEventBusAsync(eventType, eventData)); }
public OutgoingEventRecord( OutgoingEventInfo eventInfo) : base(eventInfo.Id) { EventName = eventInfo.EventName; EventData = eventInfo.EventData; CreationTime = eventInfo.CreationTime; ExtraProperties = new ExtraPropertyDictionary(); this.SetDefaultsForExtraProperties(); }
public override Task PublishFromOutboxAsync( OutgoingEventInfo outgoingEvent, OutboxConfig outboxConfig) { return(PublishAsync( AbpKafkaEventBusOptions.TopicName, outgoingEvent.EventName, outgoingEvent.EventData, new Headers { { "messageId", System.Text.Encoding.UTF8.GetBytes(outgoingEvent.Id.ToString("N")) } } )); }
public virtual async Task EnqueueAsync(OutgoingEventInfo outgoingEvent) { var dbContext = (IHasEventOutbox)await MongoDbContextProvider.GetDbContextAsync(); if (dbContext.SessionHandle != null) { await dbContext.OutgoingEvents.InsertOneAsync( dbContext.SessionHandle, new OutgoingEventRecord(outgoingEvent) ); } else { await dbContext.OutgoingEvents.InsertOneAsync( new OutgoingEventRecord(outgoingEvent) ); } }
public async override Task PublishFromOutboxAsync(OutgoingEventInfo outgoingEvent, OutboxConfig outboxConfig) { await PublishAsync(outgoingEvent.EventName, outgoingEvent.EventData, outgoingEvent.Id); }
public abstract Task PublishFromOutboxAsync( OutgoingEventInfo outgoingEvent, OutboxConfig outboxConfig );
public override Task PublishFromOutboxAsync( OutgoingEventInfo outgoingEvent, OutboxConfig outboxConfig) { return(PublishAsync(outgoingEvent.EventName, outgoingEvent.EventData, null, eventId: outgoingEvent.Id)); }