AWS Developer DVA-C02 · Development with AWS Services · hard
An AWS Lambda function polls an Amazon SQS standard queue via an Event Source Mapping with a batch size of 10 messages. During one invocation, 8 messages are processed successfully, but 2 messages fail due to a transient downstream timeout. By default, if the Lambda function throws an unhandled exception, all 10 messages return to the queue and the 8 succeeded messages get reprocessed. Which two actions should the developer take so only the 2 failed messages are retried? (Select two.)
Published · Last updated · checked before publication — how we verify questions
Options
Answers: A. Enable ReportBatchItemFailures on the Lambda SQS Event Source Mapping; D. Return a JSON payload listing failed itemIdentifier IDs in batchItemFailures
To enable partial batch responses on an SQS-to-Lambda Event Source Mapping, you must enable ReportBatchItemFailures in the Event Source Mapping configuration (functionResponseTypes: ["ReportBatchItemFailures"]) (A) and have the Lambda handler return a JSON object listing the failed message IDs under batchItemFailures: [{ "itemIdentifier": "<msgId>" }] instead of throwing an unhandled error (D).
Why the other options are wrong
- B. Set the SQS queue VisibilityTimeout to 0 seconds for every received message — Setting VisibilityTimeout to 0 makes messages immediately visible to other consumers while still executing, causing duplicate processing.
- C. Convert the Lambda execution role into a Cognito User Pool token authorizer — Cognito User Pools authenticate end-user JWTs on API Gateway, not SQS batch retry semantics.
More Development with AWS Services questions
- An Amazon API Gateway REST API fronts a legacy product-catalog backend that takes 800 ms per query. Because 90% of…
- A customer-facing checkout API built on AWS Lambda (Java 21 runtime) experiences a 3.2-second cold-start latency spike…
- An order-fulfillment workflow coordinates 6 sequential and parallel steps: reserve inventory, charge credit card…
- Five different AWS Lambda functions written in Python 3.12 share the same 45 MB internal cryptography and…
- A photo-sharing platform stores private user photos in an Amazon S3 bucket (Block Public Access = ON). When an…
- A web application hosted on https://app.example.com makes an XMLHttpRequest / fetch() POST call (with a custom…
- A financial ledger uses Amazon SQS FIFO (First-In-First-Out) queues (orders.fifo) to guarantee strict message ordering…
- A developer is designing indexes for an Amazon DynamoDB Orders table whose base primary key is CustomerId (Partition…
All Development with AWS Services questions and the topic overview →
AWS and Amazon Web Services are trademarks of Amazon.com, Inc. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by Amazon Web Services.