Courseiva

DVA-C02 Troubleshooting and Optimization Practice Question

A developer is troubleshooting an application that uses Amazon SQS. Messages are being sent to a dead-letter queue (DLQ) after the maximum receive count is exceeded. The consumer processes messages but sometimes fails. The developer wants to ensure that messages are retried immediately after a failure, without waiting for the visibility timeout. Which solution should the developer implement?

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

✓

After a failure, call ChangeMessageVisibility with a timeout of 0 to make the message immediately available for reprocessing.

The correct solution is to call ChangeMessageVisibility with a timeout of 0 after a failure. This makes the message immediately available for reprocessing by other consumers, effectively retrying without waiting for the visibility timeout. Option A (delay queue) introduces a delay, which is counterproductive. Option C (delete and re-send) loses original message attributes and is inefficient. Option D (increase visibility timeout) would delay retries, not accelerate them.

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 delay queue so that messages are not immediately visible after failure.

    Why it's wrong here

    Configuring a delay queue, or setting a message delay, makes messages invisible for a specified duration *when they are first sent to the queue*. This mechanism is designed to postpone initial processing, not to facilitate immediate reprocessing after a failure. Applying a delay would prevent immediate retries, as the message would remain invisible for the configured delay period, directly contradicting the requirement for immediate availability after a processing failure.

  • ✓

    After a failure, call ChangeMessageVisibility with a timeout of 0 to make the message immediately available for reprocessing.

    Why this is correct

    When a consumer receives a message from an SQS queue, the message becomes invisible to other consumers for the duration of the queue's visibility timeout. If processing fails, calling `ChangeMessageVisibility` with a `VisibilityTimeout` of 0 seconds explicitly overrides the current visibility timeout. This action immediately makes the message visible again in the queue, allowing another consumer (or the same consumer on a subsequent poll) to receive and attempt to process it without delay, thus enabling immediate reprocessing.

  • ✗

    Delete the message from the queue and re-send it after processing failure.

    Why it's wrong here

    Deleting a message and then re-sending it as a new message is an inefficient and problematic approach for handling processing failures. This method results in the loss of the original `MessageId` and `ReceiveCount`, which are crucial for tracking message history and properly handling poison pill messages via a Dead-Letter Queue. Furthermore, if the consumer crashes *after* deleting the original message but *before* successfully re-sending it, the message is permanently lost, violating message durability guarantees.

  • ✗

    Increase the visibility timeout to allow more time for processing.

    Why it's wrong here

    Increasing the visibility timeout is appropriate when a message's processing logic genuinely requires more time to complete successfully, preventing the message from becoming visible to other consumers prematurely. However, in a scenario where immediate reprocessing after a *failure* is desired, increasing the visibility timeout would have the opposite effect. It would prolong the period during which the message remains invisible, thereby delaying any potential retry attempts and hindering the goal of immediate availability.

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 →

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.