Azure ScheduledEnqueueTimeUtc Delayed Service Bus Queue

I ran into an odd problem. I have a cloud service A that puts messages on the service bus queue for another cloud service B to read. Cloud service B can take about a second to process what it needs to do, and then send a message back to the queue for cloud service A. When cloud service B does this, it uses ScheduledEnqueueTimeUtc to delay about 1-10 seconds in the message.

Last Friday, the azure breakthrough completely disabled this application. When I returned it online, ScheduledEnqueueTimeUtc always causes a delay of at least 10 seconds. For example, I create a date and time that in the future will be from 1 to 10 seconds. I set this as ScheduledEnqueueTimeUtc, and I also put this time as the property of the message I am sending, and compare this datetime property with the EnqueuedTimeUtc property of the message when I get it back in cloud service A. These 2 times should be pretty close to each other , and that’s how he worked months until last Friday.

So, now cloud service B says that it queues this message in 1 second. Cloud Service A says it hasn’t been in the queue for 12-14 seconds. I use async methods when posting to queues. There is no delay if I do not use ScheduledEnqueueTimeUtc, the times are close enough when I look at them back in cloud service A. But if I set ScheduledEnqueueTimeUtc even for 1 second in the future, it does not seem to appear in the queue for 12-14 seconds .

Now I'm working on this using quartz.net to schedule messages instead of setting the ScheduledEnqueueTimeUtc property. But it’s really strange that it started.

+6
source share
2 answers

From the ScheduledEnqueueTimeUtc documentation documentation :

"The time the message appears does not mean that the message will be sent at the same time, it will be installed in the queue, but the actual sending time depends on the workload of the queue and its status."

This property causes an immediate message. It will not be delivered before the scheduled time, but there is no certainty that at that time it will be delivered accurately .

If you need high resolution planning, Quartz might be an option. You can also evaluate the new task scheduler, which is part of the preview of mobile services.

+6
source

A recent regression has occurred in the functionality of ShcheduledEnqueueTimeUtc, which in some cases with edges led to the behavior that you saw above. This will be fixed in the next couple of days and you should see the expected / original behavior.

Scheduled messages may have some lag depending on how busy the queue is, but it is suitable for use in the scenario described above. Any regression in functionality that affects your application can be raised as a support ticket with Azure: http://www.windowsazure.com/en-us/support/contact/

+3
source

All Articles