NServiceBus 单进程,但多输入队列 [英] NServiceBus Single Process, but Multiple Input queues

查看:58
本文介绍了NServiceBus 单进程,但多输入队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正试图让许多应用程序通过 NSB 相互通信并驱动彼此​​的操作.出于两个原因,我想将每个应用程序放入自己的队列中:使支持人员更容易解决问题和(可能)有另一个可以扩展应用程序的地方.总线将托管在 Windows 服务中,可能只是所有应用程序共享的单个实例.每个应用程序都可以发布一条消息,该消息将由 Windows 服务获取并使用来自另一个应用程序的程序集进行处理,然后将响应消息放回到同一个队列中.可能所有应用程序和窗口服务器都可以安装在同一台机器上,安装许多做同样事情的 Windows 服务对我来说并不是一个好的答案.有没有办法让一个托管 NSB 的 Windows 服务监听多个队列?

We are trying to get many applications to communicate together and drive actions in each other via NSB. I would like to put each app into its own queue for two reasons: make it easier for support to troubleshoot problems and (possibly) have another place where I could scale the app. The bus will be hosted inside a windows service, possible just single instance that all apps will share. Each app can publish a message that will be picked up by windows service and processed using assemblies from another app, then response message will be put back onto the same queue. Potentially all apps and the window server can be installed on the same machine, and installing many windows services that do the same thing does not sound a like a good answer to me. Is there any way for one windows service hosting NSB to listen to multiple queues?

谢谢.

推荐答案

这可以使用卫星实现,但我不建议将其用于不同的应用程序.我想您会发现,当您开始向外扩展应用程序时,无论如何您最终都会在 Windows 服务和队列之间建立 1 对 1 的关系.

This is possible using a Satellite, but I wouldn't recommend it for distinct applications. I think you will find that when you start to scale out the applications, you will end up with a 1 to 1 relationship between windows services and queues anyway.

此外,通常会变得更细化,每个队列/服务有 1 种消息类型.我们已经通过与第三方的一些集成在内部达到了这一点.以下是对使用卫星的用例的描述.

Furthermore it is typical to get even more granular and have 1 message type per queue/service. We have gotten to this point internally with some integrations with third parties. Here is a description of a use case for using a Satellite.

这篇关于NServiceBus 单进程,但多输入队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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