简体   繁体   English

在BizTalk发送端口中产生两条消息(从一条输入消息中产生)

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

I want to create two messages within a pipeline component and pass this onto the Assemble stage where it would go through the BTAHL7 Microsoft Accelerator. 我想在管道组件中创建两个消息,并将其传递到Assemble阶段,在该阶段它将通过BTAHL7 Microsoft Accelerator。

The pipeline component would be placed in the Send Pipeline 'Pre-Assemble' stage. 管道组件将放置在“发送管道”“预组装”阶段。

This is the code which would return the messages. 这是将返回消息的代码。

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();

For testing purpose, I have added the two pInMsg into the an array, and looped through this array to add it to the queue. 为了进行测试,我将两个pInMsg添加到一个数组中,并遍历该数组以将其添加到队列中。 Then, returning the messages separated. 然后,返回分开的消息。

However, although the queue has 2 values, in the other parts of the pipeline (Assemble and Encode), it returns only one message. 但是,尽管队列有2个值,但在管道的其他部分(“汇编”和“编码”)中,它仅返回一条消息。

Why does it do this? 为什么这样做呢? How can I get it to return two messages? 如何获得返回两个消息的信息?

This logic won't work in Execute method. 此逻辑在Execute方法中不起作用。 You either need to implement IDisassembler interface for such pipeline and need to use it on a receive location. 您要么需要为此类管道实现IDisassembler接口,要么需要在接收位置使用它。 Or you use an orchestration to create multiple messages before sending to the send port. 或者,您可以使用业务流程在发送到发送端口之前创建多个消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM