Azure Storage Queue - Poison Messages

Pete Luetchford 21 Reputation points

Quick question: in Azure storage queues, when a message is moved to a poison queue, does the poison message get a new Message ID or is the original one preserved?



Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
2,783 questions
Azure Queue Storage
Azure Queue Storage
An Azure service that provides messaging queues in the cloud.
74 questions
No comments
{count} votes

Accepted answer
  1. MikeUrnun 5,501 Reputation points

    Hello @Pete Luetchford - Thanks for reaching out and posting on the MS Q&A!

    The short answer is that the message ID will have changed to a different GUID when you access the message again from the poison queue.

    As you've probably already read on the doc, after all five attempts fail, the functions runtime adds a message to a queue named <originalqueuename>-poison. While looking at the implementation of this operation in the code, I found that the HandlePoisonMessageAsync() method passes the message.Body (which is the string content of the message) to the AddMessageAndCreateIfNotExistsAsync() which then calls AddMessageAsync() method that'll create a new message, which will have its own GUID assigned for message ID, on the poison queue.

    I also tested it locally and was able to confirm the same behavior as well. I hope this confirmation helps, please let me know in the comments section below if you have any further questions on this one.

    Please consider contributing to MS Q&A by marking 'Accepted Answer' and ‘Upvoting’ as applicable.

1 additional answer

Sort by: Newest
  1. SaiKishor-MSFT 16,571 Reputation points Microsoft Employee

    @Pete Luetchford Thanks for reaching out to Microsoft Q&A. Poison messages is a feature that the Azure Functions team implements.

    In regard to your question, we do not allow for custom ID to be set for the message ID so ideally, the poison message would get a new message ID.

    "The MessageID element is a GUID value that identifies the message in the queue. This value is assigned to the message by the Queue service and is opaque to the client. This value may be used together with the value of the PopReceipt element to delete or update a message from the queue. The value of PopReceipt is also opaque to the client; it is required when using the Delete Message or Update Message APIs."

    Please let me know if that works or if you need any further assistance. If so, I can connect you with the functions team as needed. Thank you!


    Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is [how][1].

    Want a reminder to come back and check responses? Here is [how][2] to subscribe to a notification.