Learn how to prevent data loss when an application consuming messages from an Amazon SQS queue experiences downtime. Discover two key solutions involving message retention and dead-letter queues.
Table of Contents
Question
An application consumes messages from an Amazon Simple Queue Service (Amazon SQS) queue. The application experiences occasional downtime. As a result of the downtime, messages within the queue expire and are deleted after 1 day. The message deletions cause data loss for the application.
Which solutions will minimize data loss for the application? (Choose two.)
A. Increase the message retention period
B. Increase the visibility timeout.
C. Attach a dead-letter queue (DLQ) to the SQS queue.
D. Use a delay queue to delay message delivery
E. Reduce message processing time.
Answer
A. Increase the message retention period
C. Attach a dead-letter queue (DLQ) to the SQS queue.
Explanation
Increasing the message retention period and attaching a dead-letter queue (DLQ) to the Amazon Simple Queue Service (SQS) queue are the two most effective solutions to minimize data loss when an application consuming messages from the queue experiences occasional downtime.
- Increase the message retention period (Option A): By default, SQS retains messages for 4 days. Increasing this retention period ensures that messages remain in the queue longer, giving the application more time to process them before they expire and are deleted. This reduces the risk of data loss due to application downtime.
- Attach a dead-letter queue (DLQ) to the SQS queue (Option C): A DLQ is a separate SQS queue that receives messages that cannot be processed successfully. When the maximum receive count is exceeded for a message, SQS moves the message to the DLQ instead of deleting it. This prevents data loss by storing unprocessed messages in the DLQ until they can be analyzed and reprocessed.
The other options, such as increasing the visibility timeout (B), using a delay queue (D), and reducing message processing time (E), may help improve the application’s performance but do not directly address the issue of data loss caused by message expiration during application downtime.
Amazon AWS Certified Data Engineer – Associate DEA-C01 certification exam assessment practice question and answer (Q&A) dump including multiple choice questions (MCQ) and objective type questions, with detail explanation and reference available free, helpful to pass the Amazon AWS Certified Data Engineer – Associate DEA-C01 exam and earn Amazon AWS Certified Data Engineer – Associate DEA-C01 certification.