AWS SQS

Basic

The queue acts as a buffer between the component producing and saving data, and the component receiving the data for processing. This means the queue resolves issues that arise if the producer is producing work faster than the consumer can process it, or if the producer or consumer are only intermittently connected to the network.

** Tutorial**: http://boto.readthedocs.io/en/latest/sqs_tut.html


Basic concepts:

  • Distributed. Each message is automatically distributed to multiple SQS servers.
  • no order guarantee. If your system requires that order be preserved, you can place sequencing information in each message, so that you can reorder the messages when the queue returns them.
  • guarantee to deliver at least once
  • message is up to 256KB in size. For even larger messages, you can store the contents of the message using the Amazon Simple Storage Service (Amazon S3) or Amazon DynamoDB, and use Amazon SQS to hold a pointer to the Amazon S3 object..
  • Queue and message identifier
    • queue URL

http://sqs.us-east-1.amazonaws.com/123456789012/queue2

  • message id. Each message receives a system-assigned message ID that Amazon SQS returns to you in the [SendMessage] response.

  • receipt handle. The handle is associated with the act of receiving the message, not with the message itself. To delete the message or to change the message visibility, you must provide the receipt handle and not the message ID.

  • Visibility timeout. Because of the distributed nature, it is not guaranteed that message will not be received twice during timeout period.

  • Message Lifecycle

  • Message attributes.

    • Message attributes allow you to provide structured metadata items (such as timestamps, geospatial data, signatures, and identifiers) about the message.
    • Message attributes are optional and separate from, but sent along with, the message body.
    • This information can be used by the receiver of the message to help decide how to handle the message without having to first process the message body.
    • Each message can have up to 10 attributes.
  • SQS messages and S3

  • Long Polling


Boto3 basic operation

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 9,980评论 0 23
  • 释迦牟尼有句话: “无论你遇见谁,他都是你生命里该出现的人, 都有原因,都有使命,绝非偶然, 他一定会教会你一些什...
    阿钝阅读 210评论 0 0
  • 星期五,我们三年级的全体同学去二桥秋游。 从星期四听到叶老师宣布去秋游的消息,我的心情就开始既激动又紧张: 激动的...
    快乐的月亮公主阅读 363评论 0 0
  • 汲取当下的力量 打破那种抗拒当下,否定当下的旧模式。把对当下时刻的意识作为一种习惯,当不需要关注过去和未来时,把你...
    王增利阅读 157评论 0 0
  • 下面是培臻教育小编为大家整理的一篇关于BMAT考试:2016年能力与技巧练习(14)的文章,供大家参考,下面是详细...
    peizhenjy阅读 76评论 0 0