Courseiva
Develop for Azure storagehardMultiple ChoiceObjective-mapped

AZ-204 Develop for Azure storage Practice Question

You are developing an application that uses Azure Queue Storage. The application processes messages and must ensure that a message is not lost if the processing fails. Which visibility timeout setting should you use?

⚠ Common exam trap

A common mix-up: candidates think a longer visibility timeout provides more safety, but it actually risks message loss by hiding the message indefinitely if the consumer fails, whereas a short timeout ensures quick retries and eventual processing.

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 a short visibility timeout like 30 seconds

Setting a short visibility timeout (e.g., 30 seconds) ensures that if message processing fails, the message becomes visible again quickly for retry, preventing permanent loss. Azure Queue Storage uses a visibility timeout to hide a dequeued message from other consumers; if the processing fails and the message is not deleted, it reappears after the timeout expires. A short timeout balances retry speed with processing time, avoiding indefinite hiding that could lead to message loss if the consumer crashes.

Answer analysis

Option-by-option breakdown

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

  • Set a short visibility timeout like 30 seconds

    Why this is correct

    Setting a short visibility timeout, such as 30 seconds, is optimal because it provides sufficient time for a message consumer to process the message under normal operating conditions. If the consumer fails or crashes before completing processing and deleting the message, the message quickly becomes visible again in the queue. This allows another available worker to pick up and reprocess the message with minimal delay, ensuring high availability and fault tolerance for transient processing issues.

  • Set visibility timeout to 1 hour

    Why it's wrong here

    Setting the visibility timeout to a long duration like 1 hour is problematic because it significantly delays message reprocessing in the event of a consumer failure. If a worker dequeues a message and then crashes early in its processing, that message remains invisible for the entire 60-minute timeout period. This prolonged invisibility prevents other workers from picking up the message, leading to substantial delays in processing, reduced system throughput, and potentially missed application deadlines.

  • Set visibility timeout to infinite

    Why it's wrong here

    An infinite visibility timeout is highly detrimental as it effectively prevents any automatic retry mechanism for message processing. Once a message is dequeued with an infinite timeout, it will never automatically reappear in the queue, even if the processing worker fails or is terminated. This means the message is permanently removed from the visible queue until explicitly deleted or updated by the original (failed) consumer, leading to unrecoverable processing failures and potential data loss.

  • Set visibility timeout to 0 seconds

    Why it's wrong here

    A visibility timeout of 0 seconds is highly undesirable because it causes a message to become immediately visible to other consumers right after it is dequeued by an initial consumer. This virtually guarantees that multiple consumers will simultaneously attempt to process the same message, leading to duplicate processing. Such a scenario can result in race conditions, incorrect application state, and data corruption, as the system cannot reliably ensure that only one worker processes a given message at a time.

About these practice questions

Courseiva writes every AZ-204 question from scratch — 881 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 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.