简体   繁体   English

如何仅使用5分钟的窥视锁定即可处理发布到服务总线的长期运行的作业

[英]How to handle long running jobs that are posted to a service bus with only 5min peek lock

What do people tend to do when they have a design that put jobs on a service queue or topic that takes longer then the 5min max of peeklock? 当人们设计出将工作放在服务队列或主题上的时间超过5分钟的偷窥时间时,人们倾向于做什么?

I have been using the OnMessage(...) async messagepump of service bus and is wondering if thats not such a good idea after also since if I start moving the jobs to a table while processing them, then the messagepump will just empty the queue and I just have the problem elsewhere of making sure my jobs are scheduled even between servers. 我一直在使用服务总线的OnMessage(...)异步messagepump,想知道这是否不是一个好主意,因为如果我在处理作业时开始将作业移到表中,那么messagepump只会清空队列而且我在其他地方也遇到了问题,那就是即使在服务器之间也要确保我的作业被调度。

If you have a long running message processing workflow the you can check the lockedUntilUtc property of the message and call RenewLock at the appropriate time. 如果您的消息处理工作流运行时间很长,则可以检查消息的lockedUntilUtc属性,并在适当的时间调用RenewLock。

http://msdn.microsoft.com/en-us/library/windowsazure/microsoft.servicebus.messaging.brokeredmessage.renewlock.aspx http://msdn.microsoft.com/en-us/library/windowsazure/microsoft.servicebus.messaging.brokeredmessage.renewlock.aspx

in the next release of SDK the OnMessage processing loop will automatically do that for you so that convenience API is always a good idea to use. 在下一版SDK中,OnMessage处理循环将自动为您执行此操作,因此,方便使用API​​始终是一个好主意。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM