Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I delay the execution of an Azure function after it fails?

I am using an Azure Function (written in C#) that is triggered when there is a new message on the storage queue. The function is calling an external web-service to process the message, and when the external service is responding, everything is OK.

The problem is when the external web-site is down, and the web-client gives an exception (without a try/catch block around it). What happens then is that the function is retried (by azure) 5 times, with less than a second between each attempt. As you can imagine, the web service will probably still be down for all 5 attempts which will make azure move the message to the "poison"-queue.

Is it possible to configure the the amount of time it waits before retrying, or do i need to set up another azure function that runs once a minute to check the poison-queue for messages that then needs to be recreated in the normal queue?

like image 728
Espo Avatar asked Sep 22 '16 20:09

Espo


1 Answers

We don't currently expose a way for you to configure the visibility timeout for failed messages. It is currently hardcoded to TimeSpan.Zero as you've noticed. I agree with you that we should allow this to be customized. I've logged an issue in our public repo with more details here.

like image 85
mathewc Avatar answered Oct 25 '22 14:10

mathewc