Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam AZ-204 topic 6 question 5 discussion

Actual exam question from Microsoft's AZ-204
Question #: 5
Topic #: 6
[All AZ-204 Questions]

HOTSPOT -
You are developing an application that uses Azure Storage Queues.
You have the following code:

For each of the following statements, select Yes if the statement is true. Otherwise, select No.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: No -
The QueueDescription.LockDuration property gets or sets the duration of a peek lock; that is, the amount of time that the message is locked for other receivers.
The maximum value for LockDuration is 5 minutes; the default value is 1 minute.

Box 2: Yes -
You can peek at the message in the front of a queue without removing it from the queue by calling the PeekMessage method.

Box 3: Yes -
Reference:
https://docs.microsoft.com/en-us/azure/storage/queues/storage-dotnet-how-to-use-queues https://docs.microsoft.com/en-us/dotnet/api/microsoft.servicebus.messaging.queuedescription.lockduration

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
rajwit
Highly Voted 3 years, 3 months ago
Given answer is correct
upvoted 46 times
...
igorole
Highly Voted 3 years, 4 months ago
GetMessageAsync: Gets a message from the queue using the default request options. This operation marks the retrieved message as invisible in the queue for the default visibility timeout period. Only marks the message is invisible but does not delete.
upvoted 34 times
muggins
1 year, 10 months ago
Thank you. Provided answer's reasoning for 'Yes' is incorrect.
upvoted 3 times
...
...
raymond_abcd
Most Recent 2 months, 2 weeks ago
Given answer is correct. The GetMessage method is part of the peek-lock pattern. It retrieves a message without actually removing them from the queue until you explicitly complete, abandon, or dead-letter them.
upvoted 1 times
...
TaoLu
1 year, 2 months ago
when you use the GetMessageAsync method to retrieve a message from an Azure Storage queue, the message is removed from the queue. If you want to retrieve a message without removing it from the queue, you can use the PeekMessageAsync method instead.
upvoted 4 times
warchoon
1 year, 1 month ago
This is not a simple Queue. This is another class that does not delete the message when it is read.
upvoted 2 times
...
...
OPT_001122
1 year, 4 months ago
Given answer is correct
upvoted 1 times
...
xRiot007
1 year, 10 months ago
No - we are not configuring anything here Yes - a message that is retrieved from a queue and not marked as completely processed will return to the same queue after a given amount of time, no matter if you use Peek or Get. Yes - the queue will stay there until we decide to delete it ourselves.
upvoted 4 times
...
Miroshi
2 years, 2 months ago
2nd answer is No https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.storage.queue.cloudqueue.getmessageasync?view=azure-dotnet-legacy You Take the msg after you peeked.
upvoted 2 times
Netspud
2 years, 1 month ago
Your link appears to imply that the message is not deleted unless additional params are included. Which would suggest the answer is as quoted, yes. (Not no as you suggest)
upvoted 3 times
...
ReniRechner
2 years, 1 month ago
peek: get the message, don't lock, don't delete get: get the message, lock the message (make it invisible for some seconds) delete: delete the message intention is: if get would also delete the message from the queue, an error in the function would render the message unhandled. Thus first get, process than delete. "at least handled once"
upvoted 9 times
...
...
Yazhu
2 years, 3 months ago
I dont understand here.. its a repetitive of 9th question.. its a copy paste question why diff answers? can someone clarify me?
upvoted 1 times
Yazhu
2 years, 3 months ago
commented in wrong window..sorry
upvoted 1 times
...
...
nonoss
2 years, 6 months ago
Box 3 : Correct answer https://docs.microsoft.com/en-us/azure/storage/queues/storage-dotnet-how-to-use-queues?tabs=dotnet#delete-a-queue
upvoted 1 times
...
paru123456789
3 years, 1 month ago
Answer: No Yes Yes
upvoted 12 times
...
bhushan_786
3 years, 3 months ago
Can someone confirm if the given answers are correct or not??
upvoted 2 times
diligent176
3 years, 3 months ago
They are correct, N, Y, Y. The code does not configure lock duration. The message will remain because GetMessageAsync does not remove it. The queue will also remain after execution.
upvoted 14 times
...
...
igorole
3 years, 4 months ago
Previous comment can be ignored, sorry, the right interface is here: https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.storage.queue.cloudqueue.getmessageasync?view=azure-dotnet-legacy
upvoted 2 times
...
igorole
3 years, 4 months ago
LastLine, GetMessageAsync() is not even part of the interface, this code just won't compile. https://docs.microsoft.com/en-us/dotnet/api/azure.storage.queues.queueclient?view=azure-dotnet
upvoted 1 times
Kobee
3 years, 4 months ago
You're wrong. It's CloudQueue, not QueueClient
upvoted 4 times
...
...
gematsaljoa
3 years, 4 months ago
1. X 2. O 3. O
upvoted 5 times
...
JVTM
3 years, 5 months ago
2) explanation comments a peekMessage (which leave message in queue). But the last command is getMessageAsync() which reads the message out of the queue. So, it is not in queue anymore.
upvoted 3 times
thomas204
3 years, 5 months ago
According to me you need to call DeleteMessageAsync() to remove the message from the queue.
upvoted 21 times
ashuyop
3 years, 5 months ago
thats right https://docs.microsoft.com/en-us/azure/storage/queues/storage-dotnet-how-to-use-queues?tabs=dotnet#de-queue-the-next-message
upvoted 8 times
nonoss
2 years, 6 months ago
Dequeue a message from a queue in two steps. When you call ReceiveMessages, you get the next message in a queue. A message returned from ReceiveMessages becomes invisible to any other code reading messages from this queue. By default, this message stays invisible for 30 seconds. To finish removing the message from the queue, you must also call DeleteMessage. This two-step process of removing a message assures that if your code fails to process a message due to hardware or software failure, another instance of your code can get the same message and try again. Your code calls DeleteMessage right after the message has been processed.
upvoted 1 times
...
...
...
Magnetor
3 years, 5 months ago
GetMessageAsync() does not qet out the message from the queue
upvoted 31 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...