AWS Certified Developer Associate DVA-C02 Practice Question
A developer is working on a serverless application where a certain AWS Lambda function is responsible for processing incoming messages from a message queue. Sometimes, this function encounters malformed messages that cannot be processed successfully. Which approach should the developer take to ensure that these problematic messages are segregated for troubleshooting without causing infinite processing retries?
Allocate more computational resources to the function to reduce the chances of a message being malformed due to resource constraints.
Designate a dedicated queue to serve as a destination for messages that fail to be processed by the function.
Adjust the message visibility setting in the queue to delay reprocessing attempts beyond the time frame the function requires to complete its execution.
Revise the message handling code to be idempotent, thereby ignoring any message that has the same content as a previously processed message.
Capture exceptions within the code block and log error messages to a monitoring service without storing the problematic messages.
Set the retry attempts configuration of the function to a minimum to prevent multiple processing attempts of the same message.
To handle failed message processing, the developer should configure a dead-letter queue (DLQ) to collect messages that the Lambda function fails to process after the defined number of retries or maximum event age. This queue provides a separate storage area for failed messages, making it easier to troubleshoot and resolve issues without overwhelming the system with repeated retries. A dead-letter queue also helps to prevent potential data loss by preserving messages that might otherwise be discarded. Other options provided might address aspects of error handling but do not offer a way to store faulty messages that can't be processed for later analysis. For example, designing for idempotent operations does not help with messages that are inherently malformed; it can only prevent the same message from creating duplicate effects if processed multiple times.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a dead-letter queue (DLQ)?
Open an interactive chat with Bash
How does configuring retries work in AWS Lambda?
Open an interactive chat with Bash
Why is it important to segregate problematic messages in serverless applications?
Open an interactive chat with Bash
AWS Certified Developer Associate DVA-C02
Development with AWS Services
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access