When working with a scenario where your Microsoft Azure Function reads data from a queue, your azure functions is automatically triggered when an entry is added to the queue you wish to read from.
The SDK will call your function 5 times, and the message is only removed from the trigger queue if:
- The function was successful
- The function fails 5 times
On the 5th fail, the message is moved to the poison queue, a separate queue named [queuename]-poison.
HOW TO RETRY THE POISON QUEUE:
Microsoft have built in methods for manual and automatically poison message handling, but there is no description of how to just retry the messages. In many situations, the problem causing your issue is fixed elsewhere, and all you need to do is retry the messages.
The solution is easier that I thought: The poison queue is just another queue, so all you need to do is to point the Azure Function to the poison queue, and the messages will be executed:
MORE TO READ:
- Azure Webjobs SDK – How to handle poison messages by Microsoft.
- Azure Function and storage queue, what to do if function fails from Stackoverflow