我正在开发一个通过事件中心获取更改通知的项目(https: //learn.microsoft.com/en-us/graph/change-notifications-delivery)。
我的Azure函数(事件接收器)批量接收事件。收到每个批次后,它会处理数据(做一些工作)。第二批更新第一批设置的值。
事件中心有 3 个分区。
当多个批次同时到达时就会出现问题。 。第二批在第一批更新值之前进入。
有没有办法一次只接收一批?
我不关心批次的顺序,但我想仅在处理第一个批次后才获取下一个批次触发器。
提前致谢。
I am working on a project which gets change notifications through Event Hubs(https://learn.microsoft.com/en-us/graph/change-notifications-delivery).
My Azure Function(Event Receiver) receives the events in batches. After receiving each batch, it processes the data (does a bit of work). The second batch updates the value set by the first batch.
The Event Hub has 3 partitions.
The problem arises when multiples batches arrives at the same time. . The second batch comes in before the first batch has updated the value.
Is there a way to receive only one batch at a time?
I am not bothered about the order of batches, but I want to get the next batch trigger only after the first batch is processed.
Thanks in advance.
发布评论
评论(1)
谢谢BrunoLucas-9843和MughundhanRaveendran-MSFT 提供了宝贵的解释和一些解决方法。将您的建议作为答案发布以帮助其他社区成员。
有没有办法让事件中心触发器等到第一批处理完毕?
我看到 azure hub 的逻辑应用触发器可以一次拉取固定数量的事件并等待:
https: //learn.microsoft.com/en-us/azure/connectors/connectors-create-api-azure-event-hubs#trigger-polling-behavior
是否可以使用Durable Function来实现顺序处理?
Thank You BrunoLucas-9843 and MughundhanRaveendran-MSFT for your valuable explanation and few workarounds. Posting your suggestions as an answer to help other community members.
Is there a way to make the event hub trigger wait until the first batch is processed?
I see that logic apps triggers for azure hub can pull a fixed number of events in one pull and wait:
https://learn.microsoft.com/en-us/azure/connectors/connectors-create-api-azure-event-hubs#trigger-polling-behavior
Would it be possible to achieve the sequential processing using a Durable Function?