Reputation: 1361
Hi I have an Azure function which triggers on service bus topic message and each message takes around a minute to process. The process included reading the message, then doing some filtering, calling a blob file in blob storage and then storing the content in a Tabular storage. I get around 1000 messages one by one at a time. Initially with all default value I used to get error on "Lock supplied is invalid". After discussing it in separate posts , I was finally able to make it work by increasing the lock duration to 5 minutes and the below configuration in my host.json file.
Things are working but I am still not clear with what maxAutoRenewDuration does and how it affects the lock duration, also what is
{
"functionTimeout": "00:05:00"
}
Initially I included it in my host.json and set it for 5 hrs but now I removed it thinking it was low timeout that I was getting Lock error. So when should I use this functionTimeout? i see in MS doc that we have 5 min and 0 min as max value so can I set it to 5 hrs. is that valid? You can guide me to other docs on internet but I have already gone through MS docs and these are the doubts which are not clear to me.
{
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
},
"version": "2.0",
"extensions": {
"serviceBus": {
"prefetchCount": 1,
"messageHandlerOptions": {
"autoComplete": true,
"maxConcurrentCalls": 32,
"maxAutoRenewDuration": "00:55:00"
}
}
}
}
Upvotes: 3
Views: 2895
Reputation: 688
The maxlockduration for a service bus is 5 minutes, in scenarios on which applications will take longer than those 5 minutes the maxAutoRenewDuration comes into place. So for example if you set the maxAutoRenewDuration to 55 minutes it means that the lock will be renewed up to 11 times if necessary.
In case you are using a comsumption plan, the maximum functiontimeout is 10 minutes https://learn.microsoft.com/en-us/azure/azure-functions/functions-host-json#functiontimeout
Upvotes: 3