zoukankan      html  css  js  c++  java
  • Amazon SQS 延迟队列

    延迟队列可让您将针对队列的新消息传递操作推迟特定的秒数。如果您创建延迟队列,则发送到该队列的任何消息在延迟期间对用户都保持不可见。队列的默认(最小)延迟为 0 秒。最大延迟为 15 分钟。 

    延迟队列类似于可见性超时,因为这两种功能都使得使用者在特定的时间段内无法获得消息。二者之间的区别在于:对于延迟队列,消息在首次添加到队列时 是隐藏的;而对于可见性超时,消息只有在从队列使用后 才是隐藏的。下图说明了延迟队列和可见性超时之间的关系。

    要为单条消息 而不是整个队列设置延迟(以秒为单位),请使用消息计时器以允许 Amazon SQS 使用消息计时器的 DelaySeconds 值,而不是使用延迟队列的 DelaySeconds 值。

    Amazon SQS Delay Queues

    Delay queues let you postpone the delivery of new messages to a queue for a number of seconds. If you create a delay queue, any messages that you send to the queue remain invisible to consumers for the duration of the delay period. The default (minimum) delay for a queue is 0 seconds. The maximum is 15 minutes. For information about configuring delay queues using the AWS Management Console or the AWS SDK for Java (and the SetQueueAttributes action), see Configuring an Amazon SQS Delay Queue.

    Note

    For standard queues, the per-queue delay setting is not retroactive—changing the setting doesn't affect the delay of messages already in the queue.

    For FIFO queues, the per-queue delay setting is retroactive—changing the setting affects the delay of messages already in the queue.

    Delay queues are similar to visibility timeouts because both features make messages unavailable to consumers for a specific period of time. The difference between the two is that, for delay queues, a message is hidden when it is first added to queue, whereas for visibility timeouts a message is hidden only after it is consumed from the queue. The following diagram illustrates the relationship between delay queues and visibility timeouts.

    To set delay seconds on individual messages, rather than on an entire queue, use message timers to allow Amazon SQS to use the message timer's DelaySeconds value instead of the delay queue's DelaySeconds value.

  • 相关阅读:
    完全自主创建Wrapper Tomcat容器
    python新手菜鸟之基础篇
    使用python抓取数据之菜鸟爬虫1
    简单实现Python调用有道API接口(最新的)
    演示嵌套函数定义及使用装饰器
    纯手工搭建VS 2017(社区 免费版)离线安装包
    C#中的PropertyGrid绑定对象,通过改变某一值而动态设置部分属性的特性
    WinForm 画布的标尺和网格
    Open Source
    动态链接库-Win32 DLL的说明
  • 原文地址:https://www.cnblogs.com/cloudrivers/p/11631187.html
Copyright © 2011-2022 走看看