Question 17
Domain 2: Design Resilient ArchitecturesA batch processing application needs to read messages from a queue, process them, and only delete messages after successful processing. Which service and pattern should be used?
Correct answer: B
Explanation
Amazon SQS supports at-least-once processing by hiding a received message for the "visibility timeout" period, so other consumers cannot process it while work is in progress. The application should use "explicit deletion" after successful processing; if it fails before deleting, the message becomes visible again for retry.
Why each option is right or wrong
A. SNS with immediate deletion
B. SQS with visibility timeout and explicit deletion
Amazon SQS is the queue service that supports this workflow: when a consumer calls ReceiveMessage, the message is hidden for the queue’s visibility timeout, which can be set from 0 seconds up to 12 hours. Under the SQS API, the message is not removed automatically; the application must call DeleteMessage only after processing succeeds, otherwise the message reappears when the visibility timeout expires and can be retried.
C. Kinesis with checkpointing
D. EventBridge with Lambda