IEventProcessor - 设置偏移量

时间:2015-07-31 08:30:53

标签: azure azure-eventhub

我们正在使用一个使用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);
    }

0 个答案:

没有答案
相关问题