如何设置EventProcessorHost从现在开始读取事件(UTC)? [英] How to set the EventProcessorHost to read events from now on (UTC)?

查看:98
本文介绍了如何设置EventProcessorHost从现在开始读取事件(UTC)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用EventProcessorHost接收来自Azure EventHubs的事件.我一直没有成功尝试配置它(通过EventProcessorOptions.InitialOffsetProvider)以从UTC读取事件,但是它始终从提要的开始读取.我没有保存检查点(甚至删除了创建的BLOB容器). 这是我的设置方式:

We are using the EventProcessorHost to receive events from Azure EventHubs. I've been unsuccessfully trying to configure it (through the EventProcessorOptions.InitialOffsetProvider) to read events from UTC now on but it always reads from the start of the feed. I am not saving checkpoints (and I even deleted the BLOB container created). This is how I am setting it:

DateTime startDate = DateTime.UtcNow;

var epo = new EventProcessorOptions
            {
                MaxBatchSize = 100, 
                PrefetchCount = 100, 
                ReceiveTimeOut = TimeSpan.FromSeconds(120),  
                InitialOffsetProvider = (name) => startDate  
            };

任何指导将不胜感激.

推荐答案

我发现Blob中的checkpoint文件夹仍然存在,而我的应用程序正在考虑这一点,而忽略了我在EventProcessorOptions中设置的日期.删除容器后,它开始按预期运行(计算UTC日期).

I found that the checkpoint folder in the blob was still there and my app was considering this and ignoring the date I set in EventProcessorOptions. After I deleted the container it started to run as expected (taking in count the UTC date).

这篇关于如何设置EventProcessorHost从现在开始读取事件(UTC)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆