Set Visibility Timeout in Azure Queue Storage

Develop message-based solutions
Answer Correct answer: D, E — Use the Update message and Receive message operations to set the visibility timeout value of individual messages in queue1.

You have an Azure Queue Storage named queue1. You plan to develop code that will process messages in queue1. You need to implement a queue operation to set the visibility timeout value of individual messages in queue1. Which two operations can you use? Each correct answer presents a complete solution. NOTE: Each correct selection is worth one point.

  1. Peek at a message in the queue.
  2. Delete a message in the queue.
  3. Add a message to the queue.
  4. Update a message in the queue. Correct Answer
  5. Receive a message from the queue. Correct Answer

Community Votes

DE
100%

100% of anonymous learners picked answer DE. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

The question tests knowledge of Azure Queue Storage message operations and the specific actions that allow modifying a message's visibility timeout, avoiding the trap of assuming all retrieval operations affect visibility.

This guide explains how to set the visibility timeout for individual messages in Azure Queue Storage. It establishes that receiving and updating messages are the specific operations used to configure this timeout.

Choosing 'Peek at a message' (A) because it retrieves a message, but peeking does not hide the message or allow setting a visibility timeout.

Community Discussion (4 comments)

Vichu_1607 👍 2 Selected: DE
D. Update a message in the queue. E. Receive a message from the queue.
mahomes15 👍 3 Selected: DE
E. Receive a message from the queue: When you receive a message, it becomes invisible to other consumers for the duration of the visibility timeout. After receiving it, you can modify its visibility timeout by using the Update operation or by changing the visibility timeout parameter when processing the message. D. Update a message in the queue: This operation allows you to change the visibility timeout of a message that has been received. You can use this to reset the visibility timeout to a new value, effectively controlling how long the message remains hidden from other consumers.
Mattt 👍 3 Selected: DE
D. Update a message in the queue: The UpdateMessage operation allows you to modify the content of a message as well as reset its visibility timeout value. E. Receive a message from the queue: The ReceiveMessage operation retrieves the message from the queue and allows you to set a visibility timeout, which defines how long the message will be invisible to other consumers.
ns4098 👍 4
To set the visibility timeout of individual messages in Azure Queue Storage, you can use the following operations: D. Update a message in the queue Explanation: The Update operation allows you to modify a message’s content and its visibility timeout. You can use this operation to update the visibility timeout for a message that has already been retrieved from the queue. E. Receive a message from the queue Explanation: When you retrieve (or "receive") a message from the queue, you can specify the visibility timeout at that point. This is useful when you want to process the message but delay its visibility to other consumers.

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

Receiving a message (E) inherently involves setting a visibility timeout to hide the message from other consumers while it is being processed. Updating a message (D) explicitly allows modifying both the message content and its visibility timeout, enabling you to extend or reset the invisibility window during processing.

Why the Other Options Are Wrong

Peeking at a message (A) retrieves it without making it invisible, so no visibility timeout is applied or needed. Deleting a message (B) removes it permanently from the queue and does not set a timeout. Adding a message (C) creates a new message but does not set an initial visibility timeout for processing.

Community Comment Notes

Commenters agree that both receiving and updating messages are valid ways to interact with the visibility timeout. As mahomes15 noted, "After receiving it, you can modify its visibility timeout by using the Update operation". Mattt also pointed out that "The UpdateMessage operation allows you to modify the content of a message as well as reset its visibility timeout value."

Official Reference

Exam Strategy

When asked about modifying message visibility in Azure Queue Storage, remember that only operations that hide the message from the queue (Receive) or explicitly modify its state (Update) can set the visibility timeout. Peek leaves the message visible to all other consumers.

Related Analysis

← Back to AZ-204 Study Guide