预取是否适用于服务总线触发器?
Does prefetching work with Service Bus Trigger?
我有一个由服务总线主题触发的持久编排客户端。
[FunctionName("ServiceBusTrigger")]
public static async Task ServiceBusTrigger(
[ServiceBusTrigger("topicname", "subscriptionname", Connection = "MyServiceBusKey")]string mySbMsg,
[OrchestrationClient]DurableOrchestrationClient starter,
ILogger log)
{
string instanceId = await starter.StartNewAsync("Orchestrator", mySbMsg);
log.LogInformation($"Started orchestration with ID = '{instanceId}'.");
}
在 host.json
中的扩展下启用预取计数是否会导致在服务总线触发器中预取消息?
host.json
:
{
"version": "2.0",
"extensions": {
"serviceBus": {
"prefetchCount": 100
}
}
}
Does enabling the prefetch count under extensions in host.json cause messages to be prefetched in the Service Bus Trigger?
预取计数影响 Azure Functions SDK 使用的底层 MessageReceiver
预取的最大消息数。您必须确保 prefetchCount
已使用为 maxConcurrentCalls
定义的值正确配置,以确保没有太多消息 pre-fetched 并且在等待处理时不会丢失锁。
我有一个由服务总线主题触发的持久编排客户端。
[FunctionName("ServiceBusTrigger")]
public static async Task ServiceBusTrigger(
[ServiceBusTrigger("topicname", "subscriptionname", Connection = "MyServiceBusKey")]string mySbMsg,
[OrchestrationClient]DurableOrchestrationClient starter,
ILogger log)
{
string instanceId = await starter.StartNewAsync("Orchestrator", mySbMsg);
log.LogInformation($"Started orchestration with ID = '{instanceId}'.");
}
在 host.json
中的扩展下启用预取计数是否会导致在服务总线触发器中预取消息?
host.json
:
{
"version": "2.0",
"extensions": {
"serviceBus": {
"prefetchCount": 100
}
}
}
Does enabling the prefetch count under extensions in host.json cause messages to be prefetched in the Service Bus Trigger?
预取计数影响 Azure Functions SDK 使用的底层 MessageReceiver
预取的最大消息数。您必须确保 prefetchCount
已使用为 maxConcurrentCalls
定义的值正确配置,以确保没有太多消息 pre-fetched 并且在等待处理时不会丢失锁。