DVA-C02 Development with AWS Services Practice Question
A developer is writing a Lambda function that processes messages from an Amazon SQS queue. The function must ensure that if a message fails to process, it is retried later without blocking other messages. The queue is a standard queue. Which configuration should the developer use?
⚠ Common exam trap
The trap here is believing that any batch failure automatically retries only the failed message, when without partial batch responses the entire batch is retried and duplicates can occur.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use a Lambda event source mapping with a batch size greater than 1 and enable partial batch responses by returning batchItemFailures.
For standard queues, Lambda event source mappings support partial batch responses. When the function returns a batchItemFailures list, Lambda marks only those messages as failed, deletes the rest, and allows the failed messages to be retried according to the queue's visibility timeout and redrive policy.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Use a Lambda event source mapping with a batch size greater than 1 and enable partial batch responses by returning batchItemFailures.
Why this is correct
For standard queues, enabling partial batch responses lets the function return a list of failed message IDs. Lambda deletes only the successfully processed messages and returns the failed ones to the queue for retry, so one bad message does not force the entire batch to be reprocessed.
- ✗
Configure a dead-letter queue on the SQS queue and set maxReceiveCount to 1.
Why it's wrong here
A dead-letter queue with maxReceiveCount of 1 moves a message to the DLQ after one failed receive, which does not give the message a chance to be retried successfully. It also does not address partial batch failure handling for the remaining messages.
- ✗
Set the SQS queue's visibility timeout to 0 seconds so failed messages become immediately visible again.
Why it's wrong here
A visibility timeout of 0 seconds would make messages immediately visible to other consumers while the function is still processing them, causing duplicate processing. It does not provide a controlled retry mechanism and can lead to message loss or repeated failures.
- ✗
Configure the Lambda event source mapping with a batch size of 1 and set the maximumBatchingWindowInSeconds to 0.
Why it's wrong here
A batch size of 1 reduces the chance of a batch affecting other messages, but it does not by itself ensure that a failed message is retried later without blocking. The function must still throw an error so the message is not deleted, and visibility timeout must allow retry.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
About these practice questions
This DVA-C02 question is part of Courseiva's 1,135-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint
This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.