Azure存储队列消息(在特定时间显示) [英] Azure storage queue message (show at specific time)

查看:75
本文介绍了Azure存储队列消息(在特定时间显示)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将消息添加到Azure队列存储中,该消息将在明天恰好在24小时后显示在队列中?

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

推荐答案

如果使用的是存储客户端库,则可以在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"

这篇关于Azure存储队列消息(在特定时间显示)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆