如何用服务总线队列优雅地停止工作人员角色 [英] how to gracefully stop worker role with service bus queue

查看:68
本文介绍了如何用服务总线队列优雅地停止工作人员角色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个要求,我们要使用服务总线读取消息并基于该消息处理一些数据,并且我们要使用workerrole以获得更好的性能.

问题是,当我们尝试部署workerrole时,任何正在处理正在运行的请求的服务总线消息侦听器都将被onStop()方法终止,并且我的数据已损坏.并且我必须再次为正在进行的请求推送一条消息.

我想要的是一种机制,可以优雅地停止worker角色,以便它在退出之前处理现有的消息请求并停止侦听新消息.我该怎么做.  

 

解决方案

SO 线程,可以解决类似的问题.

--------------- -------------------------------------------------- ------------------------------

如果此答案有帮助,请单击"标记为答案"或"投票".要提供有关您的论坛体验的其他反馈,请单击 在这里 >

Hi we have a requirement we are using service bus to read message and process some data based on that message and we are using workerrole for better performance.

The issue is when we try to deploy the workerrole any service bus message listener which is processing the request which is in action gets terminated by onStop() method and my data get's corrupted. and I have to again push a message for the ongoing request.

What I want is a mechanism to gracefully stopping the worker role so that it process the existing message request before exiting and stop listening to new message. How do I do that.   

 

解决方案

You may refer the suggestion outlined on the SO thread, which addresses similar issue.

-----------------------------------------------------------------------------------------------

If this answer was helpful, click "Mark as Answer" or "Up-Vote". To provide additional feedback on your forum experience, click here


这篇关于如何用服务总线队列优雅地停止工作人员角色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆