Unable to limit the maximum number of concurrent service bus messages processed at a time
I am using Azure Functions 3.0.13 and referring to the documentation provided
I have one TimerTrigger that runs daily that puts 0...N messages on the service bus that is then processed by a function with a ServiceBusTrigger that consumes said messages.
Using the host.json input provided, however, I can see that all messages are processed at the same time regardless of setting maxConcurrentCalls to 1.
This is causing all functions to run in parallel and resulting in a deadlock on my database.
I can use the decorator [Singleton(Mode = SingletonMode.Function)] to run one at a time however this is affecting my throughput and I would rather be able to control how many messages can be processed in parallel at a time.
Am I misinterpreting the documentation or is this a bug?
host.json
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true
}
}
},
"functionTimeout": "01:00:00",
"extensions": {
"serviceBus": {
"prefetchCount": 1,
"messageHandlerOptions": {
"autoComplete": true,
"maxConcurrentCalls": 1,
"maxAutoRenewDuration": "00:05:00"
},
"batchOptions": {
"maxMessageCount": 1,
"operationTimeout": "00:05:00",
"autoComplete": true
}
},
"durableTask": {
"maxConcurrentActivityFunctions": 5,
"maxConcurrentOrchestratorFunctions": 1
}
}
}
Hi @Tyler-V , Thank you for your feedback! We will check for the possibilities internally and update you with the findings.
Any updates on this @v-bbalaiagar ?
Hi @Tyler-V , I checked this internally. We would like to know a hosting plan for your app. Here is the document to check the scaling behaviors of the various hosting plans - https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale#scale
@v-bbalaiagar we are using a premium function app as we have some longer running processes and need to have the flexibility to increase the "functionTimeout" property