Question

I'd like to change a message property before abandoning. The following code don't work. I'm receiving the message with the initial Label.

message.Label = "failed";
message.Abandon();

It it possible to define that message was abandoned?

Was it helpful?

Solution

You cannot update content of an Azure Service Bus Queue message object. Frankly, if I have to update a message content, than there is something wrong in my approach.

You can, however, update the content of an Azure Storage Queue message, using the UpdateMessage method or any of its async friends. In any case, I feel wrong the general approach of touching message content!

For your purpose I suggest that you take a look at DeadLetterQueue feature of Azure SErvice Bus Queues and Topics, or the DequeueCount property of Azure Storage message to determine whether there is something wrong with the message.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top