且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Azure存储队列消息(在特定时间显示)

更新时间:2023-11-25 12:53:16

如果使用的是存储客户端库,则可以在CloudQueue中使用addMessage重载,该重载将初始可见性延迟作为输入参数.

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.

具体来说,您必须在2.0中使用以下重载:

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)

如果使用的是1.7版,则将使用以下重载:

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

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

您可以在此处找到有关可见性超时及其工作方式的更多信息. .

虽然TTL(生存时间;即直到死亡的时间;不是生存时间)没有设置上限(自2017-07-29版开始),但是visibleTimeout必须大于或等于0,并且不能大于大于7天"

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"