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
And if it fails again it’ll put the messages back into the *same* poison queue? Or will create a poison-poison.
LikeLike
No, it will just put it back into the poison queue again.
LikeLike
Pingback: Handling poison messages from Storage Queue – My Learnings
So what if it is an ever failing message? Will that results in a infinite execution?
LikeLike
Yes, that will result in an infinite execution. Do not point to the poison queue for a long time.
LikeLike