【问题标题】:Resumed message with custom disassembler falls in infinite loop带有自定义反汇编程序的恢复消息陷入无限循环
【发布时间】:2014-03-11 15:39:44
【问题描述】:

我创建了创建消息的自定义管道组件 Disassembler,如下所示:

public void ComposeMessage(Stream processingStream,
                                        Microsoft.BizTalk.Component.Interop.IPipelineContext pc,
                                        Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg,
                                        Queue msgs
                                        )
    {
        IBaseMessage outMsg = pc.GetMessageFactory().CreateMessage();
        outMsg.AddPart("Body", pc.GetMessageFactory().CreateMessagePart(), true);
        outMsg.Context = inmsg.Context;

        processingStream.Seek(0, SeekOrigin.Begin);
        outMsg.GetPart("Body").Data = processingStream;

        msgs.Enqueue(outMsg);
    }

创建的消息正在保存到文件中。

而且效果很好,但是当反汇编程序出错并且从“BizTalk Server 管理控制台”恢复消息时 它陷入无限循环并产生大量文件直到终止。

我将 Debug.Write 添加到我的代码中,并且我看到该 Disassemble 方法在恢复消息时被多次调用。

这对 Biztalk 来说正常吗?有没有办法改变,所以 Disassemble 方法会像正常处理一样被调用一次?

【问题讨论】:

  • 究竟什么是无限循环?您的代码或消息正在不断重新提交。
  • 从我看到的标准“反汇编”函数(包含我的代码)被循环调用(由 Biztalk 管道?)。但仅适用于暂停+恢复的消息。

标签: biztalk


【解决方案1】:

如果您在管道组件中引发异常,您需要使用 catch 块中的其余输入流。我认为它正在尝试将未读数据流的其余部分作为更多消息处理。

【讨论】:

  • 是的,我确实会在错误时抛出异常。如何使用其余的输入流?读到最后?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-07-29
  • 2021-12-31
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多