我想知道是否有人知道我可以在 biztalk 数据库中的何处查看暂停消息的数据。
我需要这个,因为大约 900 条消息因验证而被暂停,我需要编辑所有这些消息,无法恢复。
我知道暂停消息的信息显示在 InstancesSuspended
表的 BizTalkMsgBoxDb
中,并且每条消息的不同部分显示在表 MessageParts
。但是我找不到存储实际数据的表。
有人知道在哪里可以做到这一点吗?
最佳答案
我找到了一种方法,当我只想阅读它们时,不会搞砸我的系统。
我是如何使用 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 });
}
然后我连接到我的数据库,填写数据集并将数据流出到字符串,代码:
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
}
}
然后我根据您的需要将每个字符串写入适当的“txt”或“xml”,您还可以使用正则表达式等过滤掉某些消息。
希望这对任何人都有帮助,它确实对我有帮助。
问候
关于database - Biztalk 暂停数据库中的消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2537313/