I'm using version 5.2.0 of the Microsoft.Azure.WebJobs.Extensions.ServiceBus package in my Azure Function. According to the docs here the new version supports automatic retry on failed operations. This is my host.json:
{
"version": "2.0",
"extensions": {
"serviceBus": {
"clientRetryOptions": {
"mode": "Exponential",
"tryTimeout": "00:02:00",
"delay": "00:00:02.00",
"maxDelay": "00:30:00",
"maxRetries": 10
}
}
}
}
Which - apart from the time values - is exactly the same as in the docs. In my Function that is triggered by a ServiceBusTrigger
I throw an exception under certain circumstances. I want the message to be delayed, as is described in the documentation. But it is put back at the head of the queue and retried immediately, with no delay. I've spent 2 working days on this, and the mish-mash of versions, incorrect documentation, and examples I've found online, I've tried all manner of permutations, but I just cannot get this to work.
I just can't see the wood for the trees, any longer. Can anyone see what I'm doing wrong?