Courseiva
Development with AWS ServicesmediumMultiple SelectObjective-mapped

DVA-C02 Development with AWS Services Practice Question

A developer is designing a highly available application using Amazon SQS and AWS Lambda. Which TWO strategies should the developer implement to ensure that messages are processed at least once? (Choose TWO.)

⚠ Common exam trap

It's easy for candidates to confuse the purpose of a Dead Letter Queue (DLQ) as a mechanism for ensuring at-least-once processing, when in fact it is for isolating messages that have exhausted retries, not for guaranteeing delivery.

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

Set the SQS queue's visibility timeout to be greater than the Lambda function's timeout.

Setting the SQS queue's visibility timeout to be greater than the Lambda function's timeout ensures that if the Lambda function fails or times out, the message becomes visible again in the queue after the visibility timeout expires, allowing another consumer to retry processing. This prevents messages from being lost due to processing failures, supporting at-least-once processing. Option E is correct because calling the SQS DeleteMessage API only after successful processing ensures that the message is not removed from the queue until it has been fully and correctly handled, so if processing fails, the message remains available for retry.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Configure a Dead Letter Queue (DLQ) to capture failed messages.

    Why it's wrong here

    Configuring a Dead Letter Queue (DLQ) is a mechanism for handling messages that fail to be processed successfully after a maximum number of retries. While DLQs prevent messages from being lost entirely, they do not directly ensure that a message is processed at least once by the primary consumer. Instead, they capture messages that have exhausted all retry attempts, moving them out of the main queue for later inspection or reprocessing, rather than facilitating initial at-least-once delivery.

  • Enable long polling on the SQS queue.

    Why it's wrong here

    Enabling long polling on an SQS queue is an optimization technique that reduces the number of empty responses and the cost associated with frequent polling. It instructs the consumer to wait for a specified duration (up to 20 seconds) for messages to become available before returning. However, long polling does not influence the message visibility timeout or the retry logic, and therefore, it does not guarantee at-least-once processing if a consumer fails or times out.

  • Use a FIFO queue to ensure exactly-once processing.

    Why it's wrong here

    An SQS FIFO (First-In, First-Out) queue guarantees both strict message ordering and exactly-once processing, meaning a message is delivered once and remains available until processed and deleted, without duplicates. The question asks for 'at-least-once' processing, which is a less stringent requirement than 'exactly-once.' While FIFO queues inherently provide at-least-once, their primary purpose and overhead are for stricter semantics, making them an over-engineered solution if only at-least-once is needed, and standard queues already offer at-least-once delivery.

  • Set the SQS queue's visibility timeout to be greater than the Lambda function's timeout.

    Why this is correct

    Setting the SQS queue's visibility timeout to be greater than the Lambda function's timeout is crucial for at-least-once processing. If the Lambda function fails or times out before successfully processing and deleting a message, the message will automatically become visible again in the queue once the SQS visibility timeout expires. This ensures that another consumer or a subsequent invocation of the Lambda function can pick up and re-process the message, guaranteeing it is processed at least once.

  • Use the SQS DeleteMessage API inside the Lambda function only after successful processing.

    Why this is correct

    Using the SQS DeleteMessage API inside the Lambda function only after successful processing is a fundamental pattern for ensuring at-least-once delivery. When a Lambda function receives a message, it becomes invisible for the duration of the visibility timeout. By explicitly deleting the message only after all processing logic has completed without error, any failure prior to deletion will cause the message to become visible again after its timeout, allowing it to be re-processed by another consumer or invocation.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

About these practice questions

Courseiva writes every DVA-C02 question from scratch — 724 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.