Amazon Simple Queue Service (Amazon SQS)

Amazon Simple Queue Service

Amazon Simple Queue Service (Amazon SQS) offers a reliable, highly scalable, hosted queue for storing messages as they travel between computers. By using Amazon SQS, developers can simply move data between distributed components of their applications that perform different tasks, without losing messages or requiring each component to be always available. Amazon SQS makes it easy to build an automated workflow, working in close conjunction with the Amazon Elastic Compute Cloud (Amazon EC2) and the other AWS infrastructure web services.

Amazon SQS works by exposing Amazon’s web-scale messaging infrastructure as a web service. Any computer on the Internet can add or read messages without any installed software or special firewall configurations. Components of applications using Amazon SQS can run independently, and do not need to be on the same network, developed with the same technologies, or running at the same time.

Sign Up for Amazon SQS


This page contains the following categories of information. Click to jump down:

Amazon SQS Functionality

  • Developers can create an unlimited number of Amazon SQS queues, each of which can send and receive an unlimited number of messages.
  • New messages can be added to a queue at any time. The message body can contain up to 8 KB of text in any format.
  • A computer can check a queue at any time for messages waiting to be read.
  • A message is “locked” while a computer is processing it, keeping other computers from trying to process it simultaneously. If processing fails, the lock will expire and the message will again be available.
  • Messages can be retained in queues for up to 4 days.
  • Developers can access Amazon SQS through standards-based SOAP and Query interfaces designed to work with any Internet-development toolkit.

Service Highlights

Amazon SQS provides significant advantages over the complexity of home-grown messaging systems or the ongoing expense of licensed or hosted systems.

Reliable – Amazon SQS runs within Amazon’s high-availability data centers, so queues will be available whenever applications need them. To prevent messages from being lost or becoming unavailable, all messages are stored redundantly across multiple servers and data centers.

Simple – Developers can utilize Amazon SQS queues by using only four APIs: CreateQueue, SendMessage, ReceiveMessage, and DeleteMessage. The SOAP and query APIs can be used with virtually any language and platform.

Scalable – Amazon SQS was designed to enable an unlimited number of computers to read and write and unlimited number of messages at any time.

Secure – Authentication mechanisms are provided to ensure that messages stored in Amazon SQS queues are secured against unauthorized access.

Inexpensive – No up-front or fixed expenses. The only costs of sending messages through Amazon SQS are small per-request handling fees and data transfer fees. For $1 a user can transmit over a half a million (500,000) messages.


Using Amazon SQS with Other AWS Infrastructure Web Services

Amazon SQS can be used with Amazon EC2, as well as Amazon S3 and Amazon SimpleDB, to make applications more flexible and scalable. A common use case is to create an integrated and automated workflow, where multiple components or modules need to communicate with each other, but can’t all process the same amount of work simultaneously. In this case, SQS queues carry messages to be processed in an orderly fashion by the user’s application running on Amazon EC2 instances. The Amazon EC2 instances can read the queue, process the job, and then post the results as messages to another SQS queue (possibly for further processing by another application). Because Amazon EC2 allows applications to scale up and down dynamically, application developers can easily vary the number of compute instances based on the amount of work in the SQS queues, to ensure that jobs are executed in a timely manner.

For example, here is how a video transcoding website uses Amazon EC2, Amazon SQS, Amazon S3, and Amazon SimpleDB together. End users submit videos to be transcoded to the website. The videos are stored in Amazon S3, and a message (“the request message”) is placed in an Amazon SQS queue (“the incoming queue”) with a pointer to the video and to the target video format in the message. The transcoding engine, running on a set of Amazon EC2 instances, reads the request message from the incoming queue, retrieves the video from Amazon S3 using the pointer, and transcodes the video into the target format. The converted video is put back into Amazon S3 and another message (“the response message”) is placed in another Amazon SQS queue (“the outgoing queue”) with a pointer to the converted video. At the same time, metadata about the video (e.g., format, date created and length) can be indexed into Amazon SimpleDB for easy querying. During this whole workflow, a dedicated Amazon EC2 instance can constantly monitor the incoming queue and, based on the number of messages in the incoming queue, is able to dynamically adjust the number of transcoding Amazon EC2 instances to meet customers’ response time requirements.


Pricing

Pay only for what you use. There is no minimum fee. Estimate your monthly bill using AWS Simple Monthly Calculator.

Please note that Amazon SQS introduced a new WSDL and pricing plan on February 6, 2008.

Pricing for the current WSDL (version 2008-01-01)

Requests

  • $0.01 per 10,000 Amazon SQS Requests ($0.000001 per Request)

Amazon SQS requests are CreateQueue, ListQueues, DeleteQueue, SendMessage, ReceiveMessage, DeleteMessage, SetQueueAttributes and GetQueueAttributes

Data Transfer

  • $0.100 per GB – all data transfer in

  • $0.170 per GB – first 10 TB / month data transfer out
  • $0.130 per GB – next 40 TB / month data transfer out
  • $0.110 per GB – next 100 TB / month data transfer out
  • $0.100 per GB – data transfer out / month over 150 TB

Data transfer “in” and “out” refers to transfer into and out of Amazon SQS. Data transferred between Amazon SQS and Amazon EC2 is free of charge (i.e., $0.00 per GB)

Pricing for the previous WSDL (version 2007-05-01). Will be deprecated on May 6, 2009.

Messages

  • $0.10 per 1,000 messages sent ($0.0001 per message sent)

Data Transfer

  • $0.100 per GB – all data transfer in

  • $0.170 per GB – first 10 TB / month data transfer out
  • $0.130 per GB – next 40 TB / month data transfer out
  • $0.110 per GB – next 100 TB / month data transfer out
  • $0.100 per GB – data transfer out / month over 150 TB

Data transfer “in” and “out” refers to transfer into and out of Amazon SQS.

(Amazon SQS is sold by Amazon Web Services LLC.)

Impact of the Price Change

We examined the effect that the new pricing would have had on Amazon SQS charges billed at the end of December 2007. Under the new plan, 76% of customers with bills greater than $1 would have received lower bills, saving an average of 71% each compared to their actual bill.


Detailed Description

Basic Queue Requests

The Amazon Simple Queue Service employs a simple interface that is easy to use and highly flexible. The following requests are provided:

  • CreateQueue: Create queues for use with your AWS account.
  • ListQueues: List your existing queues.
  • DeleteQueue: Delete one of your queues.
  • SendMessage: Add any data entries to a specified queue.
  • ReceiveMessage: Return one or more messages from a specified queue.
  • DeleteMessage: Remove a previously received message from a specified queue.
  • SetQueueAttributes: Control queue settings like the amount of time that messages are locked after being read so they cannot be read again.
  • GetQueueAttributes: See information about a queue like the number of messages in it.

Amazon SQS Message Lifecycle

Messages that are stored in Amazon SQS have a lifecycle that is easy to manage but ensures that all messages are processed.

  1. A system that needs to send a message will find an Amazon SQS queue, and use SendMessage to add a new message to it.
  2. A different system that processes messages needs more messages to process, so it calls ReceiveMessage, and this message is returned.
  3. Once a message has been returned by ReceiveMessage, it will not be returned by any other ReceiveMessage until the visibility timeout has passed. This keeps multiple computers from processing the same message at once.
  4. If the system that processes messages successfully finishes working with this message, it calls DeleteMessage, which removes the message from the queue so no one else will ever process it. If this system fails to process the message, than it will be read by another ReceiveMessage call as soon as the visibility timeout passes.

Previous WSDL Versions

The current version of Amazon SQS, along with the current pricing, is available only with the latest WSDL, version 2008-01-01. In order to allow adequate time to migrate any existing tools or applications, you may continue to use the previous WSDLs until May 6, 2009. However, usage of Amazon SQS with these older WSDL versions will continue to be charged according to the previous pricing schedule, which for most developers results in higher charges. Therefore we recommend that you migrate your applications to the updated SQS service as soon as possible, in order to take advantage of the new pricing plan.

Note that some libraries or applications may still be built upon the previous version(s) of the service (2007-05-01 or 2006-04-01). If you use a library or application that consumes Amazon SQS, please make sure you check with its provider to understand which version of the service is being used, and therefore which pricing plan will apply to you.

Details about the changes between the current WSDL version 2008-01-01 and the previous version 2007-05-01 can be found in the Migration Guide (and detailed technical information about previous WSDL versions can be found in our Technical Documentation)

::...
免责声明:
当前网页内容, 由 大妈 ZoomQuiet 使用工具: ScrapBook :: Firefox Extension 人工从互联网中收集并分享;
内容版权归原作者所有;
本人对内容的有效性/合法性不承担任何强制性责任.
若有不妥, 欢迎评注提醒:

或是邮件反馈可也:
askdama[AT]googlegroups.com


点击注册~> 获得 100$ 体验券: DigitalOcean Referral Badge

订阅 substack 体验古早写作:


关注公众号, 持续获得相关各种嗯哼:
zoomquiet


自怼圈/年番新

DU21.7

关于 ~ DebugUself with DAMA ;-)
粤ICP备18025058号-1
公安备案号: 44049002000656 ...::