Amazon Simple Queue Service (SQS) | Features, Functionality, and Interfaces Flashcards
Do your prices include taxes?
Features, Functionality, and Interfaces
Amazon Simple Queue Service (SQS) | Application Integration
Except as noted otherwise, our prices don’t include any applicable taxes and duties such as VAT or applicable sales tax.
For customers with a Japanese billing address, the use of AWS in any region is subject to Japanese Consumption Tax. For more information, see the Amazon Web Services Consumption Tax FAQ.
Can I use Amazon SQS with other AWS services?
Features, Functionality, and Interfaces
Amazon Simple Queue Service (SQS) | Application Integration
Yes. You can make your applications more flexible and scalable by using Amazon SQS with compute services such as Amazon EC2, Amazon EC2 Container Service (Amazon ECS), and AWS Lambda, as well as with storage and database services such as Amazon Simple Storage Service (Amazon S3) and Amazon DynamoDB.
One common use case is a distributed, decoupled application whose multiple components and modules need to communicate with each other, but can’t do the same amount of work simultaneously. In this case, Amazon SQS message queues carry messages to be processed by the application running on Amazon EC2 instances.
The Amazon EC2 instances can read the message queue, process the job, and then post the results as messages to another Amazon SQS message queue (for example, for further processing by another application). Because Amazon EC2 allows applications to scale up and down dynamically, application developers can vary the number of compute instances based on the amount of messages in the Amazon SQS queues using Auto Scaling, to ensure that jobs are executed in a timely manner.
Can you give me an example use case for Amazon SQS?
Features, Functionality, and Interfaces
Amazon Simple Queue Service (SQS) | Application Integration
Here is how a video transcoding website uses Amazon EC2, Amazon SQS, Amazon S3, and Amazon DynamoDB together:
End users submit videos to be transcoded to the website.
The videos are stored in Amazon S3, and a request message is placed in an incoming Amazon SQS queue with a pointer to the video and to the target video format within the message.
The transcoding engine that runs 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 response message is placed in another outgoing Amazon SQS queue with a pointer to the converted video.
At the same time, metadata about the video (format, date created, length, and so on) is indexed into Amazon DynamoDB for querying.
During this workflow, a dedicated Auto Scaling instance can constantly monitor the incoming queue. Based on the number of messages in the incoming queue, the Auto Scaling instance dynamically adjusts the number of transcoding Amazon EC2 instances to meet the response time requirements of the website’s customers.
How can I interact with Amazon SQS?
Features, Functionality, and Interfaces
Amazon Simple Queue Service (SQS) | Application Integration
You can access Amazon SQS using the AWS Management Console, which helps you create Amazon SQS queues and send messages easily.
Amazon SQS also provides a web services API. It is also integrated with the AWS SDKs, allowing you to work in the programming language of your choice.
What are the available operations for message queues?
Features, Functionality, and Interfaces
Amazon Simple Queue Service (SQS) | Application Integration
For information on message queue operations, see Amazon SQS Product Details.
Who can perform operations on a message queue?
Features, Functionality, and Interfaces
Amazon Simple Queue Service (SQS) | Application Integration
Only an AWS account owner (or an AWS account that the account owner has delegated rights to) can perform operations on an Amazon SQS message queue.
Can I use Java Message Service (JMS) with Amazon SQS?
Features, Functionality, and Interfaces
Amazon Simple Queue Service (SQS) | Application Integration
Yes. You can take advantage of the scale, low cost, and high availability of Amazon SQS without the worry and high overhead of running your own JMS cluster.
Amazon provides the Amazon SQS Java Messaging Library that implements the JMS 1.1 specification and uses Amazon SQS as the JMS provider. For more information, see Using JMS with Amazon SQS in the Amazon SQS Developer Guide.
How does Amazon SQS identify messages?
Features, Functionality, and Interfaces
Amazon Simple Queue Service (SQS) | Application Integration
All messages have a global unique ID that Amazon SQS returns when the message is delivered to the message queue. The ID isn’t required to perform any further actions on the message, but it is useful for tracking the receipt of a particular message in the message queue.
When you receive a message from the message queue, the response includes a receipt handle that you must provide when deleting the message.
How does Amazon SQS handle unsuccessfully-processed messages?
Features, Functionality, and Interfaces
Amazon Simple Queue Service (SQS) | Application Integration
In Amazon SQS, you can use the API or the console to configure dead letter queues, which are queues that receive messages from other source queues.
If you make a queue into a dead letter queue, it receives messages after a maximum number of processing attempts cannot be completed. You can use dead letter queues to isolate messages that can’t be processed for later analysis.
For more information, see “Can I use a dead letter queue with FIFO queues?” on this page and Using Amazon SQS Dead Letter Queues in the Amazon SQS Developer Guide.
What is a visibility timeout?
Features, Functionality, and Interfaces
Amazon Simple Queue Service (SQS) | Application Integration
The visibility timeout is a period of time during which Amazon SQS prevents other consuming components from receiving and processing a message. For more information, see Visibility Timeout in the Amazon SQS Developer Guide.
How does Amazon SQS allow multiple readers to access the same message queue without losing messages or processing them multiple times?
Features, Functionality, and Interfaces
Amazon Simple Queue Service (SQS) | Application Integration
Every Amazon SQS queue has a configurable visibility timeout. A message is not visible to any other reader for a designated amount of time when it is read from a message queue. As long as the amount of time it takes to process the message is less than the visibility timeout, every message is processed and deleted.
If the component processing of the message fails or becomes unavailable, the message again becomes visible to any component reading the message queue once the visibility timeout ends. This allows multiple components to read messages from the same message queue, each one working to process different messages.
What is the maximum limit for message visibility?
Features, Functionality, and Interfaces
Amazon Simple Queue Service (SQS) | Application Integration
The maximum visibility timeout for an Amazon SQS message is 12 hours.
Does Amazon SQS support message metadata?
Features, Functionality, and Interfaces
Amazon Simple Queue Service (SQS) | Application Integration
Yes. An Amazon SQS message can contain up to 10 metadata attributes. You can use message attributes to separate the body of a message from the metadata that describes it. This helps process and store information with greater speed and efficiency because your applications don’t have to inspect an entire message before understanding how to process it.
Amazon SQS message attributes take the form of name-type-value triples. The supported types include string, binary, and number (including integer, floating-point, and double). For more information, see Using Amazon SQS Message Attributes in the Amazon SQS Developer Guide.
How can I determine the time-in-queue value?
Features, Functionality, and Interfaces
Amazon Simple Queue Service (SQS) | Application Integration
To determine the time-in-queue value, you can request the SentTimestamp attribute when receiving a message. Subtracting that value from the current time results in the time-in-queue value.
What is the typical latency for Amazon SQS?
Features, Functionality, and Interfaces
Amazon Simple Queue Service (SQS) | Application Integration
Typical latencies for SendMessage, ReceiveMessage, and DeleteMessage API requests are in the tens or low hundreds of milliseconds.