Courseiva
Develop Azure compute solutionseasyMultiple ChoiceObjective-mapped

AZ-204 Develop Azure compute solutions Practice Question

You are developing a solution that processes messages from an Azure Storage Queue. Each message triggers a long-running operation that may take up to 30 minutes. You need to ensure that if the processing fails, the message is not lost and can be retried later. The current implementation uses a console application that polls the queue and deletes messages after processing. What should you change?

⚠ Common exam trap

Test-takers frequently think leaving the message in the queue (Option D) is sufficient, but they forget that the message remains invisible after being dequeued unless its visibility timeout is explicitly updated to make it visible again for retries.

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 processing fails, update the message's visibility timeout to a later time so it becomes visible again for retry.

The correct approach is to update the message's visibility timeout to a later time when processing fails. This makes the message reappear in the queue after the specified timeout, allowing another consumer to retry processing. Azure Storage Queue messages have a default visibility timeout of 30 seconds, but you can extend it to up to 7 days. This ensures the message is not lost and can be retried without being deleted or moved prematurely.

Answer analysis

Option-by-option breakdown

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

  • Move the message to a poison queue after the first failure.

    Why it's wrong here

    Moving a message to a "poison queue" (or dead-letter queue pattern) after only the first failure is premature and inefficient. This approach prevents subsequent retries for transient errors, forcing immediate manual intervention or discarding messages that might have succeeded on a later attempt. A proper retry strategy involves multiple attempts with back-off before considering a message truly "poison" and moving it.

  • After processing fails, update the message's visibility timeout to a later time so it becomes visible again for retry.

    Why this is correct

    When message processing fails due to a transient issue, updating the message's visibility timeout using the `UpdateMessage` operation is the recommended pattern. This action makes the message invisible for a specified duration, preventing other consumers from attempting to process it immediately. After the timeout expires, the message becomes visible again, allowing for a delayed retry attempt, which is crucial for resolving transient errors without losing the message.

  • Increase the polling interval to reduce the chance of missing messages.

    Why it's wrong here

    Increasing the polling interval, which dictates how frequently a consumer checks the queue for new messages, is unrelated to handling processing failures. This action would only delay the retrieval of *new* messages from the queue, potentially increasing overall message latency. It does not provide a mechanism to re-process messages that have already been retrieved but failed during their processing attempt.

  • Delete the message only if processing succeeds; otherwise, leave it in the queue.

    Why it's wrong here

    Leaving a message in the queue without updating its visibility timeout after a processing failure is problematic because the message will become visible again to consumers as soon as its original visibility timeout expires. This often results in the same failing message being picked up almost immediately by the same or another consumer, leading to rapid, repeated processing attempts that can exhaust resources or create a "hot loop" without allowing time for transient issues to resolve.

About these practice questions

One of 881 original AZ-204 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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 AZ-204 practice question is part of Courseiva's free Microsoft 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 AZ-204 exam.