如何设置EventProcessorHost从现在开始读取事件(UTC)?

编程入门 行业动态 更新时间:2024-10-27 08:29:05
本文介绍了如何设置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)?

本文发布于:2023-11-07 14:43:29,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1566729.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何设置   事件   EventProcessorHost   UTC

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!