We have created a console application that creates messages in the Azure Queue storage , and we have also developed a queue trigger that is capable of reading the messages in the queue. As part of simulating an unexpected error, we are throwing an error if the value in the queue message content is greater than 50.
Azure Functions will take care of creating a new queue with the name <OriginalQueueName>-Poison and will insert all the unprocessed messages in the new queue. Using this new poison queue, developers can review the content of the messages and take necessary actions to fix errors in the applications.
The Azure Function runtime will take care of deleting the queue message after Azure Function execution has completed successfully. If there are any problems in the execution of the Azure Function, it automatically creates a new poison queue and adds the processed messages to the new queue.