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
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