AWS Certified DevOps Engineer – Professional (DOP-C02) — Question 137
A DevOps engineer is designing an application that integrates with a legacy REST API. The application has an AWS Lambda function that reads records from an Amazon Kinesis data stream. The Lambda function sends the records to the legacy REST API.
Approximately 10% of the records that the Lambda function sends from the Kinesis data stream have data errors and must be processed manually. The Lambda function event source configuration has an Amazon Simple Queue Service (Amazon SQS) dead-letter queue as an on-failure destination. The DevOps engineer has configured the Lambda function to process records in batches and has implemented retries in case of failure.
During testing, the DevOps engineer notices that the dead-letter queue contains many records that have no data errors and that already have been processed by the legacy REST API. The DevOps engineer needs to configure the Lambda function's event source options to reduce the number of errorless records that are sent to the dead-letter queue.
Which solution will meet these requirements?
Answer options
- A. Increase the retry attempts.
- B. Configure the setting to split the batch when an error occurs.
- C. Increase the concurrent batches per shard.
- D. Decrease the maximum age of record.
Correct answer: B
Explanation
The correct answer is B because configuring the setting to split the batch when an error occurs allows the Lambda function to isolate problematic records, ensuring that only the erroneous records are sent to the dead-letter queue instead of all records in the batch. The other options do not directly address the issue of errorless records being sent to the dead-letter queue, as increasing retry attempts, concurrent batches, or decreasing record age does not resolve the problem of processing successful records incorrectly.