When a message is received from an AWS SQS queue, what happens to that message's visibility to other consumers?
Think about how SQS prevents multiple consumers from processing the same message at the same time.
When a message is received, SQS hides it from other consumers for the visibility timeout period. This ensures only one consumer processes it at a time. If the message is not deleted before the timeout expires, it becomes visible again.
You want to decouple two microservices where one sends events and the other processes them asynchronously. Which AWS service is best suited for this?
Think about a service designed specifically for message queuing and asynchronous communication.
Amazon SQS is designed to decouple components by providing a reliable message queue. EC2 runs servers, RDS is a database, and CloudFront is a content delivery network, none of which are ideal for asynchronous messaging.
Which method ensures that only authorized AWS accounts can publish messages to your SNS topic?
Consider how SNS controls who can send messages to a topic.
Resource-based policies on SNS topics specify which AWS accounts or principals can publish messages. Encryption protects message content but does not restrict who can publish. IAM roles control permissions for users or services, but publishing control is best done via topic policies. VPC endpoints restrict network access but not publishing permissions.
You want messages that fail processing multiple times to be moved automatically to a dead-letter queue. Which configuration setting controls this behavior?
Think about how SQS knows when to move a message to the DLQ after retries.
The redrive policy on the source queue includes a Maximum Receives setting. When a message is received more times than this threshold without deletion, it is moved to the dead-letter queue automatically. Encryption and IAM policies are important but do not control this behavior. Visibility timeout affects message visibility, not DLQ redrive.
You have an architecture where an SNS topic publishes messages to multiple SQS queues subscribed to it. To optimize for high throughput and ensure no message loss, which combination of settings is best?
Consider how FIFO topics and queues help with ordering and exactly-once delivery.
Using FIFO SNS topics with content-based deduplication and subscribing FIFO SQS queues ensures messages are delivered exactly once and in order, which is critical for high reliability and throughput. Standard topics and queues provide at-least-once delivery but no ordering guarantees. Disabling encryption reduces security and may not improve throughput significantly. HTTP endpoints are less reliable than SQS for message durability.