コード例 #1
0
    public virtual async Task EnqueueAsync(OutgoingEventInfo outgoingEvent)
    {
        var dbContext = (IHasEventOutbox)await DbContextProvider.GetDbContextAsync();

        dbContext.OutgoingEvents.Add(
            new OutgoingEventRecord(outgoingEvent)
            );
    }
コード例 #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));
    }
コード例 #3
0
ファイル: OutgoingEventRecord.cs プロジェクト: younes21/abp
    public OutgoingEventRecord(
        OutgoingEventInfo eventInfo)
        : base(eventInfo.Id)
    {
        EventName    = eventInfo.EventName;
        EventData    = eventInfo.EventData;
        CreationTime = eventInfo.CreationTime;

        ExtraProperties = new ExtraPropertyDictionary();
        this.SetDefaultsForExtraProperties();
    }
コード例 #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")) }
     }
                ));
 }
コード例 #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)
                );
        }
    }
コード例 #6
0
 public async override Task PublishFromOutboxAsync(OutgoingEventInfo outgoingEvent, OutboxConfig outboxConfig)
 {
     await PublishAsync(outgoingEvent.EventName, outgoingEvent.EventData, outgoingEvent.Id);
 }
コード例 #7
0
ファイル: DistributedEventBusBase.cs プロジェクト: xyfy/abp
 public abstract Task PublishFromOutboxAsync(
     OutgoingEventInfo outgoingEvent,
     OutboxConfig outboxConfig
     );
コード例 #8
0
 public override Task PublishFromOutboxAsync(
     OutgoingEventInfo outgoingEvent,
     OutboxConfig outboxConfig)
 {
     return(PublishAsync(outgoingEvent.EventName, outgoingEvent.EventData, null, eventId: outgoingEvent.Id));
 }