阻止分发者向已终止的工作人员发布消息
我对 NServiceBus 分销商有一个小问题,这可能是我自己的无知,但这就是正在发生的事情 -
我有 -
一个。 2 个工作进程(服务器)在 2 台机器上运行
b. 1 分发者进程向工作人员发布消息
c. 1 客户端进程向分发者发布消息
现在,当所有服务器都启动并运行时,一切正常。
比如说,我现在关闭了工作进程 #1,这样只有工作进程 #2 正在运行。我现在等待一段时间,然后开始向分发者发布消息,我注意到,总是有一些消息最终会排队到工作进程 #1(已关闭的进程)。
现在我想发生这种情况是因为在关闭之前服务器已向分发器指示它已准备好并且分发器正在响应这些控制消息。
我的问题是,有没有一种方法可以优雅地关闭连接到分发器的工作线程,通知它不再有消息应该排队。
谢谢。
I am having a slight issue with NServiceBus distributor and this probably my own ignorance but this is what's happening -
I have -
a. 2 Workers (Server) processes running on 2 machines
b. 1 Distributor process posting messages to the workers
c. 1 Client process posting messages to the distributor
Now it all works OK, when all servers are up and running.
Say, I now shut down Worker process #1 such that only Worker process #2 is running. I now wait for some time and then start posting messages to distributor, what I notice is that invariably some messages end up being queued to worker process #1 (the process that was shut down).
Now I suppose this happens because before shutting down the server had indicated to the distributor that it was ready and the distributor was responding to these control messages.
My question is that is there a way to gracefully close a worker connected to a distributor informing it that no more messages should be queued to it.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过向工作节点发送 ChangeNumberOfWorkerThread 消息来逐渐减少工作节点的工作线程数量。 grid目录下有一个管理工具(我认为)可以使用,只需进入分配器队列和每个工作队列即可。
You can gradually dial down the number of worker threads of a worker node by sending it ChangeNumberOfWorkerThread messages. There is a management tool under the grid directory (i think) that you can use, just need to enter in the distributor queue and each of the worker queues.