简体   繁体   English

经典Windows服务或用于服务器监视服务的WCF?

[英]Classic windows service or WCF for server monitoring service?

Currently my company uses classic Windows service that starts and runs application server. 目前,我公司使用经典的Windows服务来启动和运行应用程序服务器。 Then it uses another Windows service that monitors that service. 然后,它使用另一个监视该服务的Windows服务。

Now I'm given a task to build a web portal that will allow: - results of monitoring to be visual on portal; 现在,我被赋予建立一个门户网站的任务,该门户网站将允许:-监视结果在门户网站上可视化; - actions to be performed from portal on service that is running application; -在正在运行应用程序的服务上从门户网站执行的操作;

Considering I need two way communication where I need to: - get result whether server running service is running and in what state / a result I should get from monitoring service; 考虑到我需要在两种情况下进行双向通信:-获取结果是否正在运行服务器运行服务以及应从监视服务获得什么状态/结果; - set commands to server running service such as update config, pause, stop, etc. -将命令设置为服务器运行的服务,例如更新配置,暂停,停止等。

Now I'm thinking to move both services to WCF and provide means for these two services to communicate in between + give access to web portal for actions stated above. 现在,我正在考虑将这两种服务都迁移到WCF,并为这两种服务之间进行通信提供方法,并允许针对上述操作访问Web门户。 Web portal will be based on MVC 3. Web门户将基于MVC 3。

As I don't have much experience with WCF, I'd kindly ask for some best practice tips: - is WCF good solution for this? 由于我在WCF方面没有太多经验,所以请您提供一些最佳实践提示:-WCF是否是解决此问题的好方法? - where should I host WCF based service? -我应该在哪里托管基于WCF的服务? - is JSON instead of XML messaging doable? -可以使用JSON代替XML消息传递吗?

Also, if there is any good reference book that hits on basics of WCF windows services, I'd appreciate that too. 另外,如果有任何很好的参考书可以介绍WCF Windows服务的基础知识,我也将不胜感激。 So far books I've checked online are wast and extensive, and my time is quite limited on decision to migrate to WCF or not. 到目前为止,我在网上检查过的图书既浪费又广泛,而且我决定迁移到WCF的时间非常有限。

Thanks :) 谢谢 :)

WCF is only a way to communicate between applications. WCF只是应用程序之间进行通信的一种方式。 Main WCF goal is transport message from source to destination . WCF的主要目标是从sourcedestination传输message This is it. 就是这个。 If you want to retrieve access to some data on the server, WCF is okay, is good solution. 如果要检索对服务器上某些数据的访问权限,则WCF可以,是一个很好的解决方案。 But you should understand, if you want to gather some data in real time, I mean for example, every second check server status and store somewhere this information, it's not appropriate job for WCF. 但是您应该理解,如果您想实时收集一些数据,例如,我的意思是每隔一秒钟检查服务器状态并将此信息存储在某处,那么这对于WCF而言并不适合。 WCF is a communication. WCF是一种通信。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM