Reputation: 3583
I'm using an Azure Webjob which is triggered by Storage Queues, using [QueueTrigger] attributes, and poison message handling is done by the integration package itself.
I'm trying to find a way to set the ExpirationTime
for poison messages to something greater than the default 7 days.
Looking at the docs, these are all the configuration options available:
{
"version": "2.0",
"extensions": {
"queues": {
"maxPollingInterval": "00:00:02",
"visibilityTimeout" : "00:00:30",
"batchSize": 16,
"maxDequeueCount": 5,
"newBatchThreshold": 8,
"messageEncoding": "base64"
}
}
}
The options to configure it by code, also doesn't seem to help:
Is there a way to configure the queues so that poison messages have a custom ExpirationTime
?
Note: I am aware that you could switch to manual way of handling poison messages, and there will be a property on the queue message, however I'd prefer to not fallback to that approach.
Upvotes: 0
Views: 120
Reputation: 2336
No, There is no config available to control that. Few options depending on what works best
increase the visibility time + dequeuecount to let the message stay longer before it even moves to the poison queue https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-queue?tabs=in-process%2Cextensionv5%2Cextensionv3&pivots=programming-language-csharp#host-json
Use a different trigger to read the messages from poison queue and add it to a different queue with a longer TTL as required. Expiration date of poison queue
Register a custom queue processor that takes over the handling of poison messages and you are free to use different TTLs as required https://learn.microsoft.com/en-us/answers/questions/440576/azure-queue-storage-set-ttl-for-the-poison-queue-j.html
Upvotes: 1