监视Biztalk发送端口服务实例的“活动状态”

时间:2018-08-20 10:59:26

标签: biztalk biztalk-2010 biztalk-2013

团队,

我的biztalk发送端口实例被挂起并长时间处于活动状态。我想借助C#监视发送端口活动实例。 我打算运行一个代码,该代码将检查发送端口(作为参数传递)是否仍处于运行状态。有人可以帮我解决那段代码吗?

1 个答案:

答案 0 :(得分:0)

使用WMI MSBTS_ServiceInstance.ServiceStatus Property

public static int GetRunningServiceInstanceCount()
{
    int countofServiceInstances = 0;
    try
    {
        ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\MicrosoftBizTalkServer", "SELECT * FROM MSBTS_ServiceInstance WHERE ServiceStatus = 1 or ServiceStatus = 2");
        countofServiceInstances = searcher.Get().Count;
        return countofServiceInstances;
    }
    catch (ManagementException exWmi)
    {
        throw new System.Exception("An error occurred while querying for WMI data: " + exWmi.Message);
    }
}

要解决您的实际问题:BizTalk 2016中的SFTP适配器有great way使用最新版本的FTP代码。这样可以解决稳定性问题。

假设您使用BizTalk 2013标记,则可能未使用2016版,在这种情况下,请至少检查一下CU3,因为这样可以解决一些严重的SFTP错误。

相关问题