I have an azure function with a QueueTrigger that processes an image and outputs a blob as well as a table record.
Sometimes when processing several large images I have run into OutOfMemory exceptions, which can cause the queue item to be placed into a poison queue.
Sometimes there is a race condition and the table record being inserted errors out because there is already a record with that partition key and row key.
I could work around these issues myself within the functions, but my preferred way to handle this would be for the poison message to include a reason or the exception that caused the item to be placed in the poison queue. That way I can have another trigger listen on the poison queue and act accordingly after assessing what went wrong.
How should this be handled? I'm aware of the ErrorTrigger, which is nice to get the exception but I don't see how I can relate it back to the specific queue item that caused it.