我有一个azure python函数,队列大小为1,它似乎一次处理多条消息。这是我的host.json
我试着将扩展包更改为4.x,5.0.0,但是没有帮助
我已经浏览了文档没有帮助https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-queue-output?tabs=python-v2%2Cin-process%2Cextensionv5&pivots=programming-language-python#example
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[3.3.0, 4.0.0)"
},
"concurrency": {
"dynamicConcurrencyEnabled": true,
"snapshotPersistenceEnabled": true
},
"extensions": {
"queues": {
"maxPollingInterval": "00:00:02",
"visibilityTimeout": "00:00:30",
"batchSize": 1,
"maxDequeueCount": 5,
"newBatchThreshold": 1,
"messageEncoding": "base64"
}
}
}
1条答案
按热度按时间ncecgwcz1#
动态并发
Azure队列存储触发器有自己的消息轮询循环。使用静态配置时,并发性由BatchSize/NewBatchThreshold配置选项控制。**使用动态并发时,这些配置值将被忽略。**动态并发集成到消息循环中,因此每次迭代获取的消息数量会动态调整。启用限制时(主机过载),消息处理将暂停,直到禁用限制。禁用限制时,并发性将增加。
解决方案是从我的host.json中删除动态并发
https://learn.microsoft.com/en-us/azure/azure-functions/functions-concurrency