在 BizTalk 发送端口中生成两条消息(来自一条输入消息)

Producing two messages in BizTalk Send Port (From one input message)

我想在管道组件中创建两条消息并将其传递到 Assemble 阶段,在那里它会通过 BTAHL7 Microsoft 加速器。

管道组件将放置在发送管道 'Pre-Assemble' 阶段。

这是 return 消息的代码。

private System.Collections.Queue qOutputMsgs = new System.Collections.Queue();
IBaseMessage[] allMessages = new IBaseMessage[] { pInMsg, pInMsg };

foreach (IBaseMessage msg in allMessages)
{
   qOutputMsgs.Enqueue(msg);
}

return (IBaseMessage)qOutputMsgs.Dequeue();

出于测试目的,我将两个 pInMsg 添加到一个数组中,并循环遍历该数组以将其添加到队列中。然后,returning 将消息分开。

然而,尽管队列有 2 个值,但在管道的其他部分(Assemble 和编码),它 return 只有一条消息。

为什么要这样做?我怎样才能得到 return 两条消息?

此逻辑在 Execute 方法中不起作用。您要么需要为此类管道实现 IDisassembler 接口,要么需要在接收位置使用它。或者您使用编排在发送到发送端口之前创建多条消息。