0

Or is that behavior only available when the Function errors out.

This is for a Queue-triggered function.

Shane
  • 369
  • 1
  • 2
  • 13

3 Answers3

1

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.

Andy T
  • 10,223
  • 5
  • 53
  • 95
  • So, will timeout be considered as an error condition? I'm guessing that there's an orchestrator process which checks the status of the function. Does this process depend on the function to tell its own status? – Gaurav Mantri Jul 24 '17 at 17:49
  • I believe the property is called `dequeueCount`, max value is fixed to 5 and the messages are moved to `-poison` queue – Mikhail Shilkov Jul 24 '17 at 17:50
1

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.

Naren
  • 847
  • 4
  • 7
1

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!

Rob
  • 4,210
  • 3
  • 30
  • 25