Biztalk在数据库中暂停了消息

WtF*_*dgE 6 database biztalk messagebox

我想知道是否有人知道我在哪里可以看到biztalk数据库中已暂停消息的数据.

我需要这个,因为大约有900条消息由于验证而被暂停,我需要编辑所有这些消息,因此无法恢复.

我知道BizTalkMsgBoxDb表中显示了已暂停消息的信息,InstancesSuspended并且每个消息的不同部分都显示在表中MessageParts.但是我找不到存储实际数据的表.

有谁知道在哪里可以做到这一点?

WtF*_*dgE 2

我找到了一种方法来做到这一点,当我只想阅读它们时,不会搞砸我的系统。

我的做法是使用 Microsoft.Biztalk.Pipeline.dll 的“CompressionStreams”方法。

执行此操作的方法:

    public static Stream getMsgStrm(Stream stream)
    {
        Assembly pipelineAssembly = Assembly.LoadFrom(string.Concat(@"<path to dll>", @"\Microsoft.BizTalk.Pipeline.dll"));
        Type compressionStreamsType = pipelineAssembly.GetType("Microsoft.BizTalk.Message.Interop.CompressionStreams", true);
        return (Stream)compressionStreamsType.InvokeMember("Decompress", BindingFlags.Public | BindingFlags.InvokeMethod | BindingFlags.Static, null, null, new object[] { (object)stream });
    }
Run Code Online (Sandbox Code Playgroud)

然后我连接数据库,填写数据集并将数据流式传输到字符串,代码:

        String SelectCmdString = "select * from dbo.Parts";
        SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter(SelectCmdString, "<your connectionstring">);
        DataSet myDataSet = new DataSet();
        mySqlDataAdapter.Fill(myDataSet, "BodyParts");

        foreach (DataRow row in myDataSet.Tables["BodyParts"].Rows)
        {
            if (row["imgPart"].GetType() != typeof(DBNull))
            {
                SqlBinary binData = new SqlBinary((byte[])row["imgPart"]);
                MemoryStream stm = new MemoryStream(binData.Value);
                Stream aStream = getMsgStrm(stm);
                StreamReader aReader = new StreamReader(aStream);

                string aMessage = aReader.ReadToEnd();

                //filter msg
                //write msg
            }
        }
Run Code Online (Sandbox Code Playgroud)

然后,我根据您的需要将每个字符串写入适当的“txt”或“xml”,您还可以使用正则表达式等过滤掉某些消息。

希望这对任何人都有帮助,它确实对我有帮助。

问候