Azure storage queue message (show at specific time)

user2818430 picture user2818430 · Oct 29, 2013 · Viewed 8.5k times · Source

How can I add a message to Azure queue storage that will show up in the queue exactly tomorrow (after 24 h) ?

Answer

Veena Udayabhanu - MSFT picture Veena Udayabhanu - MSFT · Oct 30, 2013

If you are using the Storage Client Library, you will be able to use the addMessage overload in CloudQueue that takes the initial visibility delay as an input param.

Specifically, you would have to use the following overload in 2.0:

AddMessage(CloudQueueMessage message, TimeSpan? timeToLive = null, TimeSpan? initialVisibilityDelay = null, QueueRequestOptions options = null, OperationContext operationContext = null)

If you are using version 1.7, you would use the following overload:

public void AddMessage(CloudQueueMessage message, TimeSpan? timeToLive, TimeSpan? initialVisibilityDelay)

You can find more info about Visibility timeout and how it works here.

While the TTL (Time to Live;ie, time until death; not time until live) is not capped (as of version 2017-07-29) the visibilityTimeout "must be larger than or equal to 0, and cannot be larger than 7 days"