gpt4 book ai didi

c# - 如何为 Azure Functions EventHub 监听器配置接收器批量大小?

转载 作者:太空宇宙 更新时间:2023-11-03 19:49:58 24 4
gpt4 key购买 nike

最新Microsoft.Azure.WebJobs.ServiceBus package ,它使您能够 receive batches of messages来自事件中心。我想设置批量接收多少条消息。

核心 ServiceBus 库允许您重载 Receive() 函数并提供 batch size

如何在 initial config of an EventHubs receiver 中做到这一点,或者还需要什么?

最佳答案

您可以通过 host.json 中的 eventHub 配置 block 在 Functions 中执行此操作,如所述 here 。例如:

{
"eventHub": {
"maxBatchSize": 500,
"prefetchCount": 100
}
}

当我们创建 EventProcessorHost 时,我们将这些配置设置应用到 EventProcessorOptions(请参阅 here)。

关于c# - 如何为 Azure Functions EventHub 监听器配置接收器批量大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40676821/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com