With any normal Azure Queue, I pop a message, then do some work. I didn't want to delete the message until after the work is done.
How long does that message stay hidden before it's deemed a failure and is made visible again on the queue?
eg.
var message = myQueue.GetMessage();
// Do Work ..
myQueue.DeleteMessage();
My work could take .. 30 secs or something. or what happens if it took .. 1 min or 2?
I basically don't want the message to be come available again before the work is complete, incase another worker pops it off the queue .. even though this worker is still doing work.
Can we set the 'hide' time?
Can we set the 'hide' time?
Yes. You can set the time for which a message will be hidden to other callers. If you look at the REST API documentation for Get Messages
, it expects a parameter called visibilitytimeout
. This parameter is responsible for hiding the message for specified number of seconds. After that time period has elapsed, the message becomes visible again if not deleted.
How long does that message stay hidden before it's deemed a failure and is made visible again on the queue?
If you're using .Net Storage Client library, you have an option to specify the visibility timeout period. Take a look at the documentation for Get Message
where you can specify the visibility timeout. Since this is an optional parameter in the library (but required at the REST API level), default value provided by the library is 90 seconds.