What happens to a message in an AWS SQS queue when a consumer receives it but does not delete it before the visibility timeout expires?
Think about what visibility timeout means for message processing.
When a message is received, it becomes invisible for a set time (visibility timeout). If the consumer does not delete it in that time, the message becomes visible again for other consumers to process.
If an SQS message is not deleted, how long will it remain in the queue before it is automatically removed?
Check the default and maximum retention period for SQS messages.
SQS messages have a retention period that defaults to 4 days but can be configured up to 14 days. After this period, messages are deleted automatically.
You need to design an architecture using SQS to handle a very high volume of messages with minimal delay. Which approach best supports this requirement?
Consider the difference between standard and FIFO queues and how parallelism affects throughput.
Standard queues support nearly unlimited throughput and allow multiple consumers to process messages in parallel, which reduces delay. FIFO queues guarantee order but have lower throughput limits.
Which method is the most secure way to restrict access to an SQS queue so that only a specific AWS Lambda function can send and receive messages?
Think about how AWS controls permissions for services and resources.
IAM policies attached to the Lambda function's execution role can restrict which resources the function can access. Queue policies can also restrict access, but attaching a precise IAM policy to the Lambda role is the most secure and direct method.
You have an SQS queue processing messages, but some messages cause processing failures repeatedly. What is the best practice to handle these 'poison messages' to avoid blocking the queue?
Consider how SQS supports handling messages that fail processing multiple times.
Dead-letter queues allow you to isolate messages that fail processing repeatedly by moving them after a set number of receives. This prevents them from blocking the main queue and allows separate analysis or reprocessing.