使用BizTalk WMI事件:MSBTS_ServiceInstanceSuspendedEvent [英] Consuming BizTalk WMI event: MSBTS_ServiceInstanceSuspendedEvent

查看:93
本文介绍了使用BizTalk WMI事件:MSBTS_ServiceInstanceSuspendedEvent的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在制作系统原型,以侦听MSBTS_ServiceInstanceSuspendedEvent事件。


I am prototyping a system to listen to the MSBTS_ServiceInstanceSuspendedEvent events.

我使用以下代码执行此操作:

I have used the following code to do so:

ManagementEventWatcher watcher = new ManagementEventWatcher(new ManagementScope("root\\MicrosoftBizTalkServer"), new EventQuery("SELECT * FROM MSBTS_ServiceInstanceSuspendedEvent") );

watcher.EventArrived += new EventArrivedEventHandler(MyEventHandler);
watcher.Start();

MyEventHandler是打印出MSBTS_ServiceInstanceSuspendEvent公开的一些属性的方法

MyEventHandler is a method that prints out a few of the properties exposed by the MSBTS_ServiceInstanceSuspendEvent

问题是,似乎WMI事件仅针对不可恢复的挂起服务实例触发,因为事件处理程序仅针对该类型的服务实例而是针对可恢复的服务实例调用。有没有人知道是否有可能听取
暂停可恢复的服务实例?如果是,怎么样?

The problem is that it seems that WMI events are fired only for not resumable suspended service instances as the event handler is called only for that type of service instances but for the resumable ones. Is there anyone who know if it is possible to listen to suspended resumable service instances? If yes, how?

亲切的问候,

Francois Malgreve。

Francois Malgreve.

http://www.malgreve.net

推荐答案

嗨弗朗索瓦,

Hi Francois,

您可以修改WMI选择以下内容;

You can modify your WMI Select to the following;

SELECT * FROM MSBTS_MessageInstance WHERE ServiceInstanceStatus =" +(uint)ServiceInstanceStatus.Suspended_Not_Resumable +"或ServiceInstanceStatus =" +(uint)ServiceInstanceStatus.Suspended_Resumable;

SELECT * FROM MSBTS_MessageInstance WHERE ServiceInstanceStatus =" + (uint)ServiceInstanceStatus.Suspended_Not_Resumable + " or ServiceInstanceStatus = " + (uint)ServiceInstanceStatus.Suspended_Resumable;

谢谢,

William


这篇关于使用BizTalk WMI事件:MSBTS_ServiceInstanceSuspendedEvent的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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