Reputation: 5989
By default when a processing a message in an Azure Function v2, the function will be retried 10 times on error.
I actually want to reduce this but I can't find how to do it?
public static async Task Run([ServiceBusTrigger("%EventsTopicName%", "%EventsSubscriptionName%", Connection = "GetEventsConnectionString")]Message mySbMsg, ILogger log)
{
// Code to process a message
}
Upvotes: 0
Views: 633
Reputation: 5989
The solution for me was this, the ServiceBus is created using Azure ARM templates.
In order to reduce the number of retries, I was looking to do it in the code which was wrong. This is controlled in the ARM templates with the following property in the Topics config:
"maxDeliveryCount ": 2
When maxDeliveryCount is not set, by default the value is 10.
Upvotes: 1