Q55 — AWS SAA-C03 Ch.1
Question 55 of 65 | ← Chapter 1
Q55. A company has two applications: a sender application that sends messages with payloads to be processed and a processing application intended to receive the messages with payloads. The company wants to implement an AWS service to handle messages between the two applications. The sender application can send about 1,000 messages each hour. The messages may take up to 2 days to be processed. If the messages fail to process, they must be retained SO that they do not impact the processing 0f any remaining messages.Which solution meets these requirements and is the MOST operationally efficient?
- A. Set up an Amazon EC2 instance running a Redis database. Configure both applications to use the instance.Store,process,and delete the messages,respectively.
- B. Use an Amazon Kinesis data stream to receive the messages from the sender application. integrate the processingapplication with the Kinesis Client Library (KCL).
- C. Integrate the sender and processor applications with an Amazon Simple Queue Service (Amazon SQS); queue. Configure a dead-letter queue to collect the messages that failed to process. ✓
- D. Subscribe the processing application to an Amazon Simple Notification Service (Amazon SNS) topic to receive notifications to process. Integrate the sender application to write to the SNS topic.
Correct Answer: C. Integrate the sender and processor applications with an Amazon Simple Queue Service (Amazon SQS); queue. Configure a dead-letter queue to collect the messages that failed to process.
Explanation
To meet the requirements of handling messages between the sender and processing applications efficiently, the most operationally efficient solution is option C: Integrate the sender and processor applications with an Amazon Simple Queue Service (Amazon SQS) queue and configure a dead-letter queue to collect messages that failed to process. Here's why this solution is the most suitable: 1. Amazon Simple Queue Service (Amazon SQS): SQS is a fully managed message queuing service that decouples the sender and processing applications. It acts as a buffer to store the messages and provides reliable message delivery. 2. Dead-letter queue: By configuring a dead-letter queue in SQS, any messages that fail to process within a defined number of retries can be moved to the dead-letter queue for further analysis. This ensures that the processing of remaining messages is not impacted by failed messages. By implementing this solution, the company gains the following benefits: - Decoupling and scalability: SQS decouples the sender and processing applications, allowing them to operate independently and scale as needed. The sender application can send messages to the queue at its own pace, and the processing application can retrieve and process messages at its own rate. - Message retention: SQS automatically retains messages in the queue until they are explicitly deleted or moved to a dead-letter queue. This ensures that messages are not lost and can be processed even if they take up to 2 days to be processed. - Error handling: If a message fails to process within the defined number of retries, it is moved to the dead-letter queue. This allows the company to investigate and address the issue without impacting the processing of other messages. Option A suggests setting up an Amazon EC2 instance running a Redis database. While this can work, it introduces operational overhead by managing and maintaining the EC2 instance and the Redis database. It is not as operationally efficient as utilizing fully managed services like SQS. Option B suggests using an Amazon Kinesis data stream with the Kinesis Client Library (KCL) for integration with the processing application. While Kinesis can handle high message rates, it is more suitable for real-time streaming scenarios and may introduce unnecessary complexity for the given requirements. Option D suggests using Amazon Simple Notification Service (Amazon SNS) for message delivery and processing notifications. While SNS is a publish/subscribe system that can distribute messages, it does not provide the same level of decoupling and message retention as SQS, especially for messages that fail to process.