如何为Azure Functions EventHub侦听器配置Receiver批处理大小? [英] How to configure Receiver batch size for Azure Functions EventHub listener?

查看:103
本文介绍了如何为Azure Functions EventHub侦听器配置Receiver批处理大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在最新的 Microsoft.Azure.WebJobs中. ServiceBus软件包,它使您能够从eventhub接收成批的消息.我想设置要批量接收的邮件数量.

In the latest Microsoft.Azure.WebJobs.ServiceBus package, it gives you the ability to receive batches of messages from eventhubs. I would like to set how many messages I want to receive in a batch.

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

The core ServiceBus library allows you to overload the Receive() function and provide the batch size.

如何在 EventHubs接收器,还是还需要其他东西?

How does one do this in the initial config of an EventHubs receiver, or is something else required?

推荐答案

您可以通过host.json中的eventHub配置块在函数"中执行此操作,如

You can do this in Functions via the eventHub configuration block in host.json as described here. E.g.:

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

我们在创建EventProcessorHost时将这些配置设置应用于EventProcessorOptions(请参见

We apply those configuration settings to the EventProcessorOptions when we create the EventProcessorHost (see here).

这篇关于如何为Azure Functions EventHub侦听器配置Receiver批处理大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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