Reputation: 379
Or is that behavior only available when the Function errors out.
This is for a Queue-triggered function.
Upvotes: 0
Views: 1609
Reputation: 4350
From my testing, yes it seems that if an azure function times out the message is returned to the queue indefinitely.
Here's my message info 8 hours after it was submitted:
INSERTION TIME Mon, 09 Jul 2018 16:04:33 GMT
EXPIRATION TIME Mon, 16 Jul 2018 16:04:33 GMT
DEQUEUE COUNT 29
This MSDN page https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-error-pages says "The two triggers that have retry support are Azure Queue storage and Azure Blob storage. By default, these triggers are retried up to five times. After the fifth retry, both triggers write a message to a special poison queue."
This error behaviour does not hold true in the event of a function timeout; my message is at 29 retries and counting!
Upvotes: 1
Reputation: 877
As Mikhail mentioned, Function automatically retries to process a message 5 times. If it fails after 5 retries it will automatically move to poison queue <queuename>-poison
.
Following are two related posts shed a little more light on the how queue messages and processed
Here is some documentation on handling poison queue messages.
Hope this clarifies things for you.
Upvotes: 1
Reputation: 9881
If a function completes without any errors, the function will automatically mark the message as completed and it is removed from the queue.
Otherwise, the message is placed back on the queue. This will make it visible to be processed again. However, keep in mind that each time the message is processed, the DeliveryCount
will be incremented. If DeliveryCount
exceeds the queue's MaxDeliveryCount
the message is moved to the Dead Message subqueue.
Upvotes: 1