我们正在使用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)?
发布评论