简体   繁体   English

WCF客户端通道监视程序(监视)

[英]WCF Client Channel Watchdog (Monitoring)

In a current project, we have many different WCF services that implement different interfaces. 在当前的项目中,我们有许多实现不同接口的WCF服务。 Because everything is a heavily managed environment, we need to have some sort of watchdog instance for each WCF services that checks for availability to tell our management system that a certain service is available before making any calls to it. 因为所有内容都是一个受严格管理的环境,所以我们需要为每个WCF服务提供某种看门狗实例,以检查可用性以告知我们的管理系统某个服务在可用之前进行调用。

After googling for hours, the only way I see how to accomplish this is by implementing some sort of ping method in the service contract that gets called periodically in a thread to lookup the status of a service. 搜寻了几个小时之后,我看到如何完成此操作的唯一方法是在服务合同中实现某种ping方法,该方法会在线程中定期调用以查找服务状态。 But having many different services (of which some of them are black boxes that don't implement some sort of "Ping()" method), we don't want to implement the Ping() procedure for every interface. 但是,由于有许多不同的服务(其中有些是黑盒子,没有实现某种“ Ping()”方法),我们不想为每个接口都实现Ping()过程。 We already thought of implementing a management base interface for all of our contracts, but afterall, there are still web services where we can't change anything because they aren't ours. 我们已经考虑过为所有合同实现一个管理基础界面,但是毕竟,仍有Web服务无法更改任何内容,因为它们不是我们的。

Is there any possibility to achieve this? 是否有可能实现这一目标? Having some sort of service/client channel watchdog that does automatic keep alive messages / pings and reports connectivity issues or other incidents? 是否具有某种服务/客户端通道监视程序,该程序可以自动保持活动消息/ ping并报告连接问题或其他事件?

Too long for a comment grrr... 注释评论太久了...

Have you checked ServiceMon and examined it's extensibility?... look at WCF service health monitoring or simply is it possible to query each service using HTTPGet and check for content in it's response which would imply it's running? 您是否检查过ServiceMon并检查了它的可扩展性?...查看WCF服务运行状况监视,还是可以使用HTTPGet查询每个服务并检查其响应中的内容(这暗示它正在运行)?

A simple way is to ping the wsdl. 一种简单的方法是ping wsdl。 If the webservice is down, you'll get an error when trying to get and fetch that info. 如果网络服务关闭,则尝试获取和获取该信息时会出现错误。

A WCF serice is no more than a website (a special website, but a website after all), so any website monitoring tool will do the job. WCF服务不仅仅是一个网站(一个特殊的网站,但毕竟是一个网站),因此任何网站监视工具都可以完成此工作。

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

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