开发者

Server architecture question. (WCF+NServiceBus)

开发者 https://www.devze.com 2022-12-14 14:36 出处:网络
First of all i will describe current state: Server consists of several WCF services, hosted in one or several win services ondiffirent machines.

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 consol开发者_JAVA技巧e(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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消