Amazon Simple Queue Service
Encyclopedia
Amazon Simple Queue Service (Amazon SQS) is a distributed queue
messaging service introduced by Amazon.com
in April of 2006. It supports programmatic sending of messages via web service applications as a way to communicate over the internet. The intent of SQS is to provide a highly scalable hosted message queue
that resolves issues arising from the common producer-consumer problem
or connectivity between producer and consumer.
Amazon SQS can be described as commoditization of the messaging service. Well-known examples of messaging service technologies include Java Message Service
and Microsoft Message Queuing
. Whereas with Java Message Service
, for instance, users would have to maintain their own server, Amazon SQS does it for them and sells the service at a per-use rate.
Expected message latency, , was 2-10 seconds.
(AWS) identification to do this, requiring users to have an AWS enabled account with Amazon.com; this can be created at http://aws.amazon.com. AWS assigns a pair of related identifiers, your AWS access keys, to an AWS enabled account to perform identification. The first identifier is a public 20-character Access Key. This key is included in an AWS service request to identify the user. If the user is not using SOAP (protocol) with WS-Security
, a digital signature is calculated using the Secret Access Key. The Secret Access Key is a 40-character private identifier. AWS uses the Access Key ID provided in a service request to look up an account's Secret Access Key. Amazon.com then calculates a digital signature with the key. If they match then the user is considered authentic, if not then the authentication fails and the request is not processed.
Messages can be of any type, and the data contained within is not restricted. Message bodies were initially limited to 8KB in size but was later raised to 64KB on 2010-07-01. For larger messages, the user has a few options to get around this limitation. A large message can be split into multiple segments that are sent separately, or the message data can be stored using Amazon Simple Storage Service (Amazon S3) or Amazon SimpleDB
with just a pointer to the data transmitted in the SQS message.
The service supports both unlimited queues and message traffic.
There is a Visibility timeout placed on messages once they are delivered to prevent other components from consuming already delivered. The "clock" for the visibility timeout starts once a message is sent, the default time being 30 seconds. If the queue is not told to delete the message, using the receipt handle, before the timeout is over, the message becomes visible again and able to be resent. SQS automatically purges messages residing in queues for longer than 4 days.
Queue
A queue is a particular kind of collection in which the entities in the collection are kept in order and the principal operations on the collection are the addition of entities to the rear terminal position and removal of entities from the front terminal position. This makes the queue a...
messaging service introduced by Amazon.com
Amazon.com
Amazon.com, Inc. is a multinational electronic commerce company headquartered in Seattle, Washington, United States. It is the world's largest online retailer. Amazon has separate websites for the following countries: United States, Canada, United Kingdom, Germany, France, Italy, Spain, Japan, and...
in April of 2006. It supports programmatic sending of messages via web service applications as a way to communicate over the internet. The intent of SQS is to provide a highly scalable hosted message queue
Message queue
In computer science, message queues and mailboxes are software-engineering components used for interprocess communication, or for inter-thread communication within the same process. They use a queue for messaging – the passing of control or of content...
that resolves issues arising from the common producer-consumer problem
Producer-consumer problem
In problem is a classical example of a multi-process synchronization problem. The problem describes two processes, the producer and the consumer, who share a common, fixed-size buffer used as a queue. The producer's job is to generate a piece of data, put it into the buffer and start again...
or connectivity between producer and consumer.
Amazon SQS can be described as commoditization of the messaging service. Well-known examples of messaging service technologies include Java Message Service
Java Message Service
The Java Message Service API is a Java Message Oriented Middleware API for sending messages between two or more clients. JMS is a part of the Java Platform, Enterprise Edition, and is defined by a specification developed under the Java Community Process as JSR 914...
and Microsoft Message Queuing
Microsoft Message Queuing
Microsoft Message Queuing or MSMQ is a Message Queue implementation developed by Microsoft and deployed in its Windows Server operating systems since Windows NT 4 and Windows 95. The latest Windows 7 also includes this component...
. Whereas with Java Message Service
Java Message Service
The Java Message Service API is a Java Message Oriented Middleware API for sending messages between two or more clients. JMS is a part of the Java Platform, Enterprise Edition, and is defined by a specification developed under the Java Community Process as JSR 914...
, for instance, users would have to maintain their own server, Amazon SQS does it for them and sells the service at a per-use rate.
Expected message latency, , was 2-10 seconds.
Authentication
Amazon SQS provides authentication procedures to allow for secure handling of data. Amazon uses its Amazon Web ServicesAmazon Web Services
Amazon Web Services is a collection of remote computing services that together make up a cloud computing platform, offered over the Internet by Amazon.com...
(AWS) identification to do this, requiring users to have an AWS enabled account with Amazon.com; this can be created at http://aws.amazon.com. AWS assigns a pair of related identifiers, your AWS access keys, to an AWS enabled account to perform identification. The first identifier is a public 20-character Access Key. This key is included in an AWS service request to identify the user. If the user is not using SOAP (protocol) with WS-Security
WS-Security
WS-Security is a flexible and feature-rich extension to SOAP to apply security to web services. It is a member of the WS-* family of web service specifications and was published by OASIS....
, a digital signature is calculated using the Secret Access Key. The Secret Access Key is a 40-character private identifier. AWS uses the Access Key ID provided in a service request to look up an account's Secret Access Key. Amazon.com then calculates a digital signature with the key. If they match then the user is considered authentic, if not then the authentication fails and the request is not processed.
Message Delivery
Amazon SQS guarantees At-Least-Once delivery. Messages are stored on multiple servers for redundancy and to ensure availability. If a message is delivered while a server is not available it may not be removed from that server's queue and may be resent. , Amazon SQS does NOT guarantee reception of messages by the recipient in the order they were sent by the sender. If message ordering is important it is required that the application place sequencing information within the messages to allow for reordering after delivery.Messages can be of any type, and the data contained within is not restricted. Message bodies were initially limited to 8KB in size but was later raised to 64KB on 2010-07-01. For larger messages, the user has a few options to get around this limitation. A large message can be split into multiple segments that are sent separately, or the message data can be stored using Amazon Simple Storage Service (Amazon S3) or Amazon SimpleDB
Amazon SimpleDB
Amazon SimpleDB is a distributed database written in Erlang by Amazon.com. It is used as a web service in concert with Amazon Elastic Compute Cloud and Amazon S3 and is part of Amazon Web Services. It was announced on December 13, 2007....
with just a pointer to the data transmitted in the SQS message.
The service supports both unlimited queues and message traffic.
Message Deletion
SQS does not automatically delete messages once they are sent. When a message is delivered a receipt handle is generated for that delivery and sent to the recipient. These receipts are not sent with the message but in addition to it. They are required to delete the message from the queue. This feature is new as of 2008 where only the message ID was required for message deletion. Because of the systems distributed nature, a message may be sent more than once. In this case the most recent receipt handle is needed to delete the message. Amazon reserves the right to delete an entire queue without notification if it has not been accessed for 30 consecutive days.There is a Visibility timeout placed on messages once they are delivered to prevent other components from consuming already delivered. The "clock" for the visibility timeout starts once a message is sent, the default time being 30 seconds. If the queue is not told to delete the message, using the receipt handle, before the timeout is over, the message becomes visible again and able to be resent. SQS automatically purges messages residing in queues for longer than 4 days.