[英]How to configure for singleton - Queue Triggered Azure Function
I'd like an azure function that's triggered from an Azure storage account queue to run as a singleton.我喜欢azure ZC1C1C425268E683851AB5074C174F174C174F14F14F14F14F14F174F14Z是从Z3A580F14220367F1F1F1F1556ATAS ASER INCOR触发的触发的,
The function app is in-process and net6: function 应用程序正在进行中,并且 net6:
<TargetFramework>net6.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
My function currently looks as follows:我的 function 目前看起来如下:
[FunctionName(nameof(QueueTrigger))]
public async Task QueueBatch([QueueTrigger("TriggerSurvey")] TriggerMsg triggerMsg)
Anyone know how to configure so that only one instance of the function will ever poll the queue?任何人都知道如何配置,以便只有一个 function 实例将轮询队列?
The batch size and the threshold for getting a new batch are configurable in the host.json file.
批量大小和获取新批次的阈值可在 host.json 文件中配置。 If you want to minimize parallel execution for queue-triggered functions in a function app, you can set the batch size to 1. This setting eliminates concurrency only so long as your function app runs on a single virtual machine (VM).
如果您想最小化 function 应用程序中队列触发函数的并行执行,您可以将批处理大小设置为 1。只要您的 function 应用程序在单个虚拟机 (VM) 上运行,此设置就会消除并发性。
host.json > extensions > queues > batchSize
https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-queue-trigger?tabs=csharp https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-queue-trigger?tabs=csharp
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.