1

iterface IEventProcessor を使用している EvenProcessor を使用しています。Azure Eventhub に接続すると、常に「すべて」のデータが取得されますが、「ライブ」データのみが必要です。DateTimeを使用してオフセットを設定することについて読んでいましたが、どこにあるのかわかりません。成功せずに試してみました。出来ますか?以下にコードの一部を添付します。

    public class EventProcessor : IEventProcessor
    {
    IDictionary<string, int> map;
    PartitionContext partitionContext;
    Stopwatch checkpointStopWatch;

    public EventProcessor()
    {
        this.map = new Dictionary<string, int>();
    }

    public Task OpenAsync(PartitionContext context)
    {
        context.Lease.Offset = DateTime.Now.ToString(); // not working - still gives all data
        this.partitionContext = context;
        this.checkpointStopWatch = new Stopwatch();
        this.checkpointStopWatch.Start();
        return Task.FromResult<object>(null);
    }
4

0 に答える 0