How long does a message remain hidden in the Azure queue before it becomes visible again?

With any normal Azure Queue, I exit the message and then do some work. I did not want to delete the message until the work was completed.

How long does this message remain hidden until it is considered a failure and is again visible in the queue?

eg.

var message = myQueue.GetMessage(); // Do Work .. myQueue.DeleteMessage(); 

My work may take 30 seconds or something else. or what happens if required .. 1 min or 2?

Basically, I don't want the message to appear again before the work is completed if another worker jumped out of the queue. Although this worker is still working.

Is it possible to set the "hide" time?

+6
source share
2 answers

Is it possible to set the "hide" time?

Yes. You can set the time during which the message will be hidden to other subscribers. 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 the specified number of seconds. After this period of time, the message becomes visible again, if not deleted.

How long does this message remain hidden until it is considered a failure and appears again in the queue?

If you use the .Net Storage Client library, you have the option to specify a timeout period for visibility. 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 necessary for the REST API level), the default value provided by the library is 90 seconds.

+13
source

As a parameter for one of the GetMessage () overloads, you can specify the timeout for visibility. You can also use UpdateMessage () to extend the invisibility of a message. However, you can never guarantee that a message will not be processed twice - for example, a consumer dies after shutting down, but before the message is deleted. Windows Azure queues are the most efficient FIFO queue β€” with at least semantics.

+9
source

Source: https://habr.com/ru/post/956053/


All Articles