Simple Queue Service and Kinesis Flashcards
When a consumer grabs a message from an SQS queue, what happens to the message? (Select two.)
It is immediately deleted from the queue.
It remains in the queue for 30 seconds and is then deleted.
It remains in the queue for the remaining duration of the retention period.
It becomes invisible to other consumers for the duration of the visibility timeout.
C, D. After a consumer grabs a message, the message is not deleted. Instead, the message becomes invisible to other consumers for the duration of the visibility timeout. The message is automatically deleted from the queue after it’s been in there for the duration of the retention period.
What is the default visibility timeout for an SQS queue?
0 seconds
30 seconds
12 hours
7 days
B. The default visibility timeout for a queue is 30 seconds. It can be configured to between 0 seconds and 12 hours.
What is the default retention period for an SQS queue?
30 minutes
1 hour
1 day
4 days
7 days
14 days
D. The default retention period is 4 days but can be set to between 1 minute and 14 days.
You want to make sure that only specific messages placed in an SQS queue are not available for consumption for 10 minutes. Which of the following settings can you use to achieve this?
Delay queue
Message timer
Visibility timeout
Long polling
B. You can use a message timer to hide a message for up to 15 minutes. Per‐queue delay settings apply to all messages in the queue unless you specifically override the setting using a message timer.
Which of the following SQS queue types can handle over 50,000 in‐flight messages?
FIFO
Standard
Delay
Short
B. A standard queue can handle up to 120,000 in‐flight messages. A FIFO queue can handle up to about 20,000. Delay and short are not valid queue types.
What SQS queue type always delivers messages in the order they were received?
FIFO
Standard
LIFO
FILO
Basic
A. FIFO queues always deliver messages in the order they were received. Standard queues usually do as well, but they’re not guaranteed to. LIFO, FILO, and basic aren’t valid queue types.
You have an application that uses long polling to retrieve messages from an SQS queue. Occasionally, the application crashes because of duplicate messages. Which of the following might resolve the issue?
Configure a per‐queue delay.
Use a standard queue.
Use a FIFO queue.
Use short polling.
C. Standard queues may occasionally deliver a message more than once. FIFO queues will not. Using long polling alone doesn’t result in duplicate messages.
A producer application places messages in an SQS queue, and consumer applications poll the queue every 5 seconds using the default polling method. Occasionally, when a consumer polls the queue, SQS reports there are no messages in the queue, even though there are. When the consumer subsequently polls the queue, SQS delivers the messages. Which of the following may explain the missing messages?
Using long polling
Using short polling
Using a FIFO queue
Using a standard queue
B. Short polling, which is the default, may occasionally fail to deliver messages. To ensure delivery of these messages, use long polling.
Which of the following situations calls for a dead‐letter queue?
A message sits in the queue for too long and gets deleted.
Different consumers receive and process the same message.
Messages are mysteriously disappearing from the queue.
A consumer repeatedly fails to process a particular message.
D. Dead‐letter queues are for messages that a consumer is unable to process. To use a dead‐letter queue, you create a queue of the same type as the source queue, and set the maxReceiveCount to the maximum number of times a message can be received before it’s moved to the dead‐letter queue.
A message that’s 6 days old is sent to a dead‐letter queue. The retention period for the dead‐letter queue and the source queue is 10 days. What will happen to the message?
It will sit in the dead‐letter queue for up to 10 days.
It will be immediately deleted.
It will be deleted after four days.
It will sit in the dead‐letter queue for up to 20 days.
C. If the retention period for the dead‐letter queue is 10 days, and a message is already 6 days old when it’s moved to the dead‐letter queue, it will spend at most 4 days in the dead‐letter queue before being deleted.
You’re developing an application to predict future weather patterns based on RADAR images. Which of the following Kinesis services is the best choice to support this application?
Kinesis Data Streams
Kinesis Video Streams
Kinesis Data Firehose
Kinesis ML
B. Kinesis Video Streams is designed to work with time‐indexed data such as RADAR images. Kinesis ML doesn’t exist.
You’re streaming image data to Kinesis Data Streams and need to retain the data for 30 days. How can you do this? (Choose two.)
Create a Kinesis Data Firehose delivery stream.
Increase the stream retention period to 14 days.
Specify an S3 bucket as the destination.
Specify CloudWatch Logs as the destination.
A, C. You can’t specify a retention period over 7 days, so your only option is to create a Kinesis Data Firehose delivery stream that receives data from the Kinesis Data Stream and sends the data to an S3 bucket.
Which of the following Kinesis services requires you to specify a destination for the stream?
Kinesis Video Streams
Kinesis Data Streams
Kinesis Data Firehose
Kinesis Data Warehouse
C. Kinesis Data Firehose requires you to specify a destination for a delivery stream. Kinesis Video Streams and Kinesis Data Streams use a producer‐consumer model that allows consumers to subscribe to a stream. There is no such thing as Kinesis Data Warehouse.
You’re running an on‐premises application that frequently writes to a log file. You want to stream this log file to a Kinesis Data Stream. How can you accomplish this with the least effort?
Use the CloudWatch Logs Agent.
Use the Amazon Kinesis Agent.
Write a script that uses the Kinesis Producer Library.
Move the application to an EC2 instance.
B. The Amazon Kinesis Agent can automatically stream the contents of a file to Kinesis. There’s no need to write any custom code or move the application to EC2. The CloudWatch Logs Agent can’t send logs to a Kinesis Data Stream.
When deciding whether to use SQS or Kinesis Data Streams to ingest data, which of the following should you take into account?
The frequency of data
The total amount of data
The number of consumers that need to receive the data
The order of data
C. SQS and Kinesis Data Streams are similar. But SQS is designed to temporarily hold a small message until a single consumer processes it, whereas Kinesis Data Streams is designed to provide durable storage and playback of large data streams to multiple consumers.