服务器架构问题。 (WCF+NServiceBus)

发布于 2024-08-15 13:24:41 字数 606 浏览 2 评论 0原文

首先我将描述当前状态:
服务器由多个 WCF 服务组成,托管在不同计算机上的一个或多个 win 服务中。

  1. 负责从不同设备接收数据的服务。与设备的通信是使用套接字实现的。服务实例模式——单例。
  2. 数据代理服务 - 负责保存数据并按请求共享。实例模式——单例。
  3. 配置服务 - 负责更改配置数据库并使用管理控制台(WPF 应用程序,如 SSMS)。处理来自控制台、订户管理等的连接。实例模式 - 单例。
  4. 客户端访问服务 - 与上面的客户端管理完全相同,但也通知客户端新数据,并且充当服务总线的外观。又单身了。
  5. 身份管理服务 - 检查权限并返回结果。辛格尔顿。

所有这些服务都与 NServiceBus 连接,我真的很喜欢它此时的工作方式。

但是:
单身人士太多了。主要是因为要使用 servicebus 我必须有它的单个实例。我不知道也许我可以在会话模式下使用 nservice 总线,但不知道如何处理所有这些服务都将使用一个队列的问题。

如果我有 300 多个客户怎么办?单身人士可能会变得反应迟钝..

我想就这一切征求一些批评者的意见,也许有人可以提出一些建议。

提前致谢。
阿列克谢

First of all i will describe current state:
Server consists of several WCF services, hosted in one or several win services on diffirent machines.

  1. Service responsible for recieving data from diffirent devices. Communication with devices is implemented using sockets. Service instance mode - singleton.
  2. Data broker service - responsible for persisting data and sharing in by request. Instance mode - singleton.
  3. Configuration service - responsible for changing configuration database and working with administration console(WPF app, like SSMS). Handles connections from console, subscriber management, etc. Instance mode - singleton.
  4. Client access service - quite the same as above thith management of clients but also notifyes clients of new data, and acts like facade to service bus. And singleton again.
  5. Identity management service - Checks permissions and returns result. Singleton.

All of those services are connected with NServiceBus and i realy like how it works at this moment.

But:
Too many singletons. Mainly because to use servicebus i must have single instance of it afaik. I dunno maybe i can use nservice bus in session mode, but dont know how to handle issue that all of those services will use one queue.

And what if i will have 300+ clients? singleton can become unresponsive..

And i wanted to ask for some critics about all of this and maybe some one could suggest something.

Thanks in advance.
Alexey

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦中楼上月下 2024-08-22 13:24:41

Alexey,

虽然每个进程应该只有一个总线实例,但您可以将该实例放在全局可访问的位置(如 AsyncPages 示例中所示),并从非单例对象(如网页和 WCF 服务)使用该实例。

此外,让所有服务都使用一个队列可能并不合适。如果没有更好地了解您的情况,我会为您确定的每一项服务提供一个队列的默认建议。

希望有帮助。

Alexey,

While you should only have one instance of the bus per process, you can put that instance in a globally accessible place (as shown in the AsyncPages sample), and use that from non-singleton objects like web pages and WCF services.

Also, it is probably not appropriate to have all your services using one queue. Without better understanding your situation, I'd give the default recommendation of one queue for each of the services you identified.

Hope that helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文