Azure storage queue message (show at specific time)

戏子无情 提交于 2019-11-28 03:27:33

问题


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


回答1:


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"



来源:https://stackoverflow.com/questions/19658494/azure-storage-queue-message-show-at-specific-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!