Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to change an Azure queue message invisibility timeout without posting the data?

With the 1.6 SDK (Version 2011-08-18) you can change the invisibility timeout of a queue message. However, reading the REST documentation, it would seem to show that you have to post back the message. I understand that the operation is meant to update the entire message (including invisibility timeout), but I only want to change the invisibility timeout without having to resend the entire message. Is this possible?

Thanks, Erick

like image 916
Erick T Avatar asked Dec 04 '22 18:12

Erick T


1 Answers

Update the Queue Message with Flag Settings MessageUpdateFields.Visibility regardless of the value of Message contents. e.g.

message.SetMessageContent("");
queue.UpdateMessage(message, visibilityTimeout, MessageUpdateFields.Visibility);

this will not change the message contents to Empty string and contents will remain intact and would update the Visibility timeout only.

To update the contents as well as visibility timeout,

queue.UpdateMessage(message, visibilityTimeout, MessageUpdateFields.Content | MessageUpdateFields.Visibility);
like image 78
Jash Avatar answered Mar 13 '23 00:03

Jash