Esempio n. 1
0
    public virtual async Task EnqueueAsync(OutgoingEventInfo outgoingEvent)
    {
        var dbContext = (IHasEventOutbox)await DbContextProvider.GetDbContextAsync();

        dbContext.OutgoingEvents.Add(
            new OutgoingEventRecord(outgoingEvent)
            );
    }
Esempio n. 2
0
    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));
    }
Esempio n. 3
0
    public OutgoingEventRecord(
        OutgoingEventInfo eventInfo)
        : base(eventInfo.Id)
    {
        EventName    = eventInfo.EventName;
        EventData    = eventInfo.EventData;
        CreationTime = eventInfo.CreationTime;

        ExtraProperties = new ExtraPropertyDictionary();
        this.SetDefaultsForExtraProperties();
    }
Esempio n. 4
0
 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")) }
     }
                ));
 }
Esempio n. 5
0
    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);
 }
Esempio n. 7
0
 public abstract Task PublishFromOutboxAsync(
     OutgoingEventInfo outgoingEvent,
     OutboxConfig outboxConfig
     );
Esempio n. 8
0
 public override Task PublishFromOutboxAsync(
     OutgoingEventInfo outgoingEvent,
     OutboxConfig outboxConfig)
 {
     return(PublishAsync(outgoingEvent.EventName, outgoingEvent.EventData, null, eventId: outgoingEvent.Id));
 }