SQS - Message Visibility Timeout/Long Polling/FIFO Flashcards
What is the message visibility timeout in SQS?
The message visibility timeout is the period during which a message, once polled by a consumer, is invisible to other consumers.
What is the default visibility timeout in SQS?
30 seconds.
What happens if a message is not processed within the visibility timeout?
The message becomes visible again in the queue and can be reprocessed by the same or another consumer.
Why is the visibility timeout important?
It prevents multiple consumers from processing the same message simultaneously and ensures orderly message processing.
What is the risk of setting the visibility timeout too high?
If a consumer crashes, the message remains invisible for an extended period, delaying its reprocessing.
What is the risk of setting the visibility timeout too low?
If the consumer cannot process the message in time, the message becomes visible again, potentially leading to duplicate processing.
What is the maximum visibility timeout you can configure in SQS?
12 hours.
What is long polling in Amazon SQS?
Long polling allows a consumer to wait for messages to arrive in the queue, reducing the number of API calls and latency.
What is the maximum duration for long polling?
20 seconds.
What are the benefits of long polling?
Fewer API calls: Reduces the frequency of polling requests.
Lower latency: Messages are sent to consumers as soon as they arrive in the queue.
Cost savings: Fewer API calls result in reduced costs.
What does FIFO stand for in Amazon SQS?
First In, First Out. It ensures that messages are processed in the exact order they are sent.
When should you use an SQS FIFO queue?
When message ordering is critical.
When exactly-once processing is required.
When your application can work within the throughput constraints of FIFO queues.