Setting TTL for poison queue messages

PAUL FALLOWS 21 Reputation points


I have successfully amended the TTL when adding a new message to a queue. However, if the function fails to successfully process the message it’s added to the poison queue with the default TTL.

What would be the best way to change the TTL for poison queue messages? Register my own IQueueProcessFactory? If so how would I do that(I have attempted this unsuccessfully). What would I need to override for the poison queue message?

Any help would be much appreciated.



Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,520 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Pramod Valavala 20,606 Reputation points Microsoft Employee

    @PAUL FALLOWS Unfortunately, I believe there is no way to change this as this is handled by the binding directly with no options exposed to configure this.

    Instead, you could either do one of the following:

    1. Handle Poison Messages Explicitly
      This requires you catching errors and sending messages to the poison queue due to invalid content or whatever your scenario demands.

    This, however, does not handle the case for where messages are sent to the poison queue for cases where you do not catch errors on.

    1. Forward Messages from Poison Queue
      This approach would be to have a separate function that monitors the poison queue and re-queues messages as appropriate to another queue with all the properties set.
    0 comments No comments