Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

azure storage queue message live time

Did I understood it right that in Windows Azure Queue storage a message can live for 7 days maximum?

What happens with the message after 7 days?

What happens with the message if you read it once during the 7 days and you don't delete it? I mean you read the message from the queue and set the visibility timeout to let's say 1 minute. What happens after you have read the message (without deleting it) and the 1 minutes timeout visibility expires? I know is back and available on the queue but what happens with the 7 days TTL of that message, is it renewed to 7 days from that point or is 7 days totally since message was created?

like image 320
user2818430 Avatar asked Oct 29 '13 12:10

user2818430


People also ask

What is message storage time?

The message storage retention period defines how long messages and data are retained before deletion. A longer retention period requires additional storage space. Messages older than the specified storage period are automatically deleted.

What is visibility timeout in Azure queue?

The visibilitytimeout mechanism, supported by Azure Storage Queues, causes the message to become invisible after read for a specified period of time. If the processing unit fails to delete the message in the specified time, the message will reappear on the queue. Then another process can retry the message.

What is the difference between Azure storage queue and Service Bus queue?

Storage queues provide a uniform and consistent programming model across queues, tables, and BLOBs – both for developers and for operations teams. Service Bus queues provide support for local transactions in the context of a single queue.


3 Answers

Yes, you understood it correctly. Messages from queues are deleted automatically within 7 days time and there is nothing called 're-newed'. Once inserted into the queue storage, it will be deleted automatically and there is no way you can recover it back(there are no recovery tools either).

like image 76
Newton Sheikh Avatar answered Oct 22 '22 09:10

Newton Sheikh


You can now opt-in to infinite TTL for Azure Storage Queue messages by specifying an expiry time of -1 seconds when initially queuing the message.

The time-to-live interval for the message, in seconds. Prior to version 2017-07-29, the maximum time-to-live allowed is 7 days. For version 2017-07-29 or later, the maximum time-to-live can be any positive number, as well as -1 indicating that the message does not expire. If this parameter is omitted, the default time-to-live is 7 days.

https://learn.microsoft.com/en-us/rest/api/storageservices/put-message#uri-parameters

like image 25
Bevan Avatar answered Oct 22 '22 08:10

Bevan


When adding a message, users specify a time to live (< 7 days) after which the message is automatically deleted if it still exists in the queue.

Maybe you need to use Windows Azure Service Bus Queue. Take a look at a great comparison between the two Queues available at Azure:

http://msdn.microsoft.com/en-us/library/windowsazure/hh767287.aspx

like image 2
Thiago Custodio Avatar answered Oct 22 '22 10:10

Thiago Custodio