Amazon Simple Queue Service (SQS) | Features, Functionality, and Interfaces Flashcards

1
Q

Do your prices include taxes?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Can I use Amazon SQS with other AWS services?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Can you give me an example use case for Amazon SQS?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can I interact with Amazon SQS?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the available operations for message queues?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

For information on message queue operations, see Amazon SQS Product Details.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Who can perform operations on a message queue?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Can I use Java Message Service (JMS) with Amazon SQS?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does Amazon SQS identify messages?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How does Amazon SQS handle unsuccessfully-processed messages?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a visibility timeout?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the maximum limit for message visibility?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

The maximum visibility timeout for an Amazon SQS message is 12 hours.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Does Amazon SQS support message metadata?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How can I determine the time-in-queue value?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the typical latency for Amazon SQS?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

Typical latencies for SendMessage, ReceiveMessage, and DeleteMessage API requests are in the tens or low hundreds of milliseconds.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

For anonymous access, what is the value of the SenderId attribute for a message?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

When the AWS account ID is not available (for example, when an anonymous user sends a message), Amazon SQS provides the IP address.

17
Q

What is Amazon SQS long polling?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

Amazon SQS long polling is a way to retrieve messages from your Amazon SQS queues. While the regular short polling returns immediately, even if the message queue being polled is empty, long polling doesn’t return a response until a message arrives in the message queue, or the long poll times out.

Long polling makes it inexpensive to retrieve messages from your Amazon SQS queue as soon as the messages are available. Using long polling might reduce the cost of using SQS, because you can reduce the number of empty receives. For more information, see Amazon SQS Long Polling in the Amazon SQS Developer Guide.

18
Q

Is there an additional charge for using Amazon SQS long polling?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

No. Long-polling ReceiveMessage calls are billed exactly the same as short-polling ReceiveMessage calls.

19
Q

When should I use Amazon SQS long polling, and when should I use Amazon SQS short polling?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

In almost all cases, Amazon SQS long polling is preferable to short polling. Long-polling requests let your queue consumers receive messages as soon as they arrive in your queue while reducing the number of empty ReceiveMessageResponse instances returned.

Amazon SQS long polling results in higher performance at reduced cost in the majority of use cases. However, if your application expects an immediate response from a ReceiveMessage call, you might not be able to take advantage of long polling without some modifications to your application.

For example, if your application uses a single thread to poll multiple queues, switching from short polling to long polling will probably not work, because the single thread will wait for the long-poll timeout on any empty queues, delaying the processing of any queues that might contain messages.

In such an application, it is a good practice to use a single thread to process only one queue, allowing the application to take advantage of the benefits that Amazon SQS long polling provides.

20
Q

What value should I use for my long-poll timeout?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

In general, you should use maximum 20 seconds for a long-poll timeout. Because higher long-poll timeout values reduce the number of empty ReceiveMessageResponse instances returned, try to set your long-poll timeout as high as possible.

If the 20-second maximum doesn’t work for your application (see the example in the previous question), set a shorter long-poll timeout, as low as 1 second.

All AWS SDKs work with 20-second long polls by default. If you don’t use an AWS SDK to access Amazon SQS, or if you configured your AWS SDK to specifically have a shorter timeout, you might need to modify your Amazon SQS client to allow longer requests or to use a shorter long-poll timeout.

21
Q

What is the AmazonSQSBufferedAsyncClient for Java?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

The AmazonSQSBufferedAsyncClient for Java provides an implementation of the AmazonSQSAsyncClient interface and adds several important features:

Automatic batching of multiple SendMessage, DeleteMessage, or ChangeMessageVisibility requests without any required changes to the application

Prefetching of messages into a local buffer that allows your application to immediately process messages from Amazon SQS without waiting for the messages to be retrieved

Working together, automatic batching and prefetching increase the throughput and reduce the latency of your application while reducing your costs by making fewer Amazon SQS requests. For more information, see Client-Side Buffering and Request Batching in the Amazon SQS Developer Guide.

The Amazon SQS Buffered Asynchronous Client does not currently support FIFO queues.

22
Q

Where can I download the AmazonSQSBufferedAsyncClient for Java?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

You can download the AmazonSQSBufferedAsyncClient as part of the AWS SDK for Java.

23
Q

Do I have to rewrite my application to use the AmazonSQSBufferedAsyncClient for Java?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

No. The AmazonSQSBufferedAsyncClient for Java is implemented as a drop-in replacement for the existing AmazonSQSAsyncClient.

If you update your application to use the latest AWS SDK and change your client to use the AmazonSQSBufferedAsyncClient for Java instead of the AmazonSQSAsyncClient, your application will receive the added benefits of automatic batching and prefetching.

24
Q

How can I subscribe Amazon SQS message queues to receive notifications from Amazon SNS topics?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

In the Amazon SQS console, select an Amazon SQS standard queue.

Under Queue Actions, select Subscribe Queue to SNS Topic from the drop-down list.

In the dialog box, select the topic from the Choose a Topic drop-down list, and click Subscribe.

For more information, see Subscribing a Queue to an Amazon SNS Topic in the Amazon SQS Developer Guide.

25
Q

How can I fan out identical messages to multiple Amazon SQS queues?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

Use Amazon SNS to create a topic.

Create and subscribe multiple Amazon SQS standard queues to the Amazon SNS topic.

Whenever a message is sent to the Amazon SNS topic, it is fanned out to the Amazon SQS message queues.

Amazon SNS delivers the message to all Amazon SQS message queues subscribed to the topic.

26
Q

Does Amazon SNS provide at-least-once delivery of messages to Amazon SQS queues?

Features, Functionality, and Interfaces

Amazon Simple Queue Service (SQS) | Application Integration

A

Amazon SNS is designed such that each message is delivered at least once to Amazon SQS standard queues.