Azure Storage Queue message (shown at a specific time)

How do I add a message to the Azure Queue repository that will appear in the queue exactly tomorrow (after 24 hours)?

+8
source share
1 answer

If you use the warehouse client library, you can use the addMessage overload in CloudQueue, which takes the initial visibility delay as an input parameter.

In particular, you will 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 must use the following overload:

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

You can find more information about the visibility timeout and how it works here .

Although TTL (lifetime; i.e., time to death; not time to life) is unlimited (starting from version 2017-07-29), visibilityTimeout "must be greater than or equal to 0 and cannot be longer than 7 days"

+24
source

Source: https://habr.com/ru/post/956942/


All Articles