azure storage queue message live time
Asked Answered
S

5

14

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?

Solferino answered 29/10, 2013 at 12:20 Comment(0)
C
7

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).

Checani answered 29/10, 2013 at 13:21 Comment(0)
Z
21

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

Zephyr answered 1/4, 2018 at 21:25 Comment(3)
This might be a more relevant link? learn.microsoft.com/en-us/rest/api/storageservices/… "Specifies 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."Whitener
Depending on the method you use to add the queue message, some methods like the CloudQueue AddMessageAsync require a type of TimeSpan for the TTL so you can't just supply -1. In this case, you can achieve a functionally equivalent result with TimeSpan.MaxValueTricornered
The way to set the time to live to infinite using the C# SDK, which also expects a TimeSpan, is to use TimeSpan.FromSeconds(-1)Trencherman
C
7

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).

Checani answered 29/10, 2013 at 13:21 Comment(0)
S
3

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

Spritsail answered 29/10, 2013 at 13:17 Comment(0)
S
2

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

I think earlier never expire option was not there but, now you can add messagettl=-1 to make it never expire

Messgae TTL Azure Storage Queue Message

Soricine answered 28/2, 2023 at 8:55 Comment(0)
C
1

Yes 7 day is maximum. There is feedback feature request here . You can go and comment

https://feedback.azure.com/forums/217298-storage/suggestions/4134167-infinite-ttl-for-queue-messages

Coen answered 4/11, 2016 at 3:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.