简体   繁体   English

BizTalk 信封架构和分批说明

[英]Explanation of BizTalk envelope schemas and debatching

I'm currently self-studying BizTalk as part of a new role, and have picked up the core concepts of developing Orchestrations and configuring pipelines.作为新角色的一部分,我目前正在自学 BizTalk,并掌握了开发编排和配置管道的核心概念。 Recently I've been trying to get my head around debatching resultsets containing multiple records into separate messages using Envelope Schemas, and finally got it working last week by using the below tutorials;最近,我一直在尝试使用信封模式将包含多条记录的结果集分批成单独的消息,最后通过使用以下教程在上周开始工作;

https://docs.microsoft.com/en-us/biztalk/core/walkthrough-using-xml-envelopes-basic https://blog.tallan.com/2014/12/23/typed-polling-with-wcf-adapters/ https: //docs.microsoft.com/en-us/biztalk/core/walkthrough-using-xml-envelopes-basic https://blog.tallan.com/2014/12/23/typed-polling-with-wcf -适配器/

What I'm looking for if possible is for someone kind enough to give me an understanding of the mechanics involved so that I can confirm my understanding of the process to incorporate fully into my solutions.如果可能的话,我正在寻找的是一个足够友善的人,让我了解所涉及的机制,以便我可以确认我对流程的理解,以便完全融入我的解决方案。

My understanding is: The Receive Pipeline is using the XML Disassembler to break apart my message on the basis that I've flagged the receiving schema as an Envelope.我的理解是:接收管道正在使用 XML 反汇编程序来分解我的消息,因为我已将接收模式标记为信封。

This is where my question kicks in. On the schema, I'm setting the parent node's Body XPath to that of the node ABOVE the final node containing the result elements.这就是我的问题所在。在架构上,我将父节点的 Body XPath 设置为包含结果元素的最终节点上方的节点。 Why am I doing this, and what does it do exactly?我为什么要这样做,它到底做了什么?

My vague grasp of the outcome is that it grabs the resulting record from the bottom node, and uses that Body XPath as a reference on where to obtain the child nodes/elements to create the new message?我对结果的模糊理解是它从底部节点获取结果记录,并使用该 Body XPath 作为在哪里获取子节点/元素以创建新消息的参考?

On the schema, I'm setting the node's Body XPath to that of the node ABOVE the final node containing the result elements.在架构上,我将节点的 Body XPath 设置为包含结果元素的最终节点上方的节点。 Why am I doing this, and what does it exactly?我为什么要这样做,它到底是做什么的?

My vague grasp of the outcome is that it grabs the resulting record from the bottom node, and uses that Body XPath as a reference on where to obtain the child nodes/elements to create the new message?我对结果的模糊理解是它从底部节点获取结果记录,并使用该 Body XPath 作为在哪里获取子节点/元素以创建新消息的参考?

I (too?) had some trouble understanding the reasoning behind the wording Body XPath, since it's actually the envelope you're selecting.我(也是?)在理解Body XPath 措辞背后的原因时遇到了一些困难,因为它实际上是您选择的信封。

What it's doing: you're telling BizTalk that all records below that node should be treated as individual messages.它在做什么:您告诉 BizTalk 该节点下的所有记录都应被视为单独的消息。 It doesn't have to be a single record, or even a single type of message.它不必是单个记录,甚至不是单一类型的消息。 So, you can collect a bunch of different messages from a single data source, and process them all individually.因此,您可以从单个数据源收集一堆不同的消息,并单独处理它们。

It's not the node above the 'final/bottom' node per se, since an envelope can contain a bunch of other types (in case you want to do some validation on the receiving part).它本身不是“最终/底部”节点上方的节点,因为信封可以包含一堆其他类型(如果您想对接收部分进行一些验证)。

The example from your first link allows pretty much any XML below the body, since it's using an Any element.您的第一个链接中的示例几乎允许身体下方的任何 XML ,因为它使用Any元素。 That means I could just add a Warning record to their example:这意味着我可以在他们的示例中添加一条Warning记录:

<Envelope xmlns="http://BasicXMLEnvelope">
  <Error>
    <ID>102</ID>
    <Type>0</Type>
    <Priority>High</Priority>
    <Description>Sprocket query fails.</Description>
    <ErrorDateTime>1999-05-31T13:20:00.000-05:00</ErrorDateTime>
  </Error>
  <Error>
    <ID>16502</ID>
    <Type>2</Type>
    <Priority>Low</Priority>
    <Description>Time threshold exceeded.</Description>
    <ErrorDateTime>1999-05-31T13:20:00.000-05:00</ErrorDateTime>
  </Error>
  <Warning>
    <ID>333</ID>
    <Description>Just a warning.</Description>
    <WarningDateTime>2019-10-07T15:15:00.000+02:00</WarningDateTime>
  </Warning>
</Envelope>

Using the described debatching method, this single incoming message will result in three messages in the message box;使用所描述的分批方法,这个单一的传入消息将导致消息框中的三个消息;

<Error>
  <ID>102</ID>
  <Type>0</Type>
  <Priority>High</Priority>
  <Description>Sprocket query fails.</Description>
  <ErrorDateTime>1999-05-31T13:20:00.000-05:00</ErrorDateTime>
</Error>

... and... ... 和...

<Error>
  <ID>16502</ID>
  <Type>2</Type>
  <Priority>Low</Priority>
  <Description>Time threshold exceeded.</Description>
  <ErrorDateTime>1999-05-31T13:20:00.000-05:00</ErrorDateTime>
</Error>

... and... ... 和...

<Warning>
  <ID>333</ID>
  <Description>Just a warning.</Description>
  <WarningDateTime>2019-10-07T15:15:00.000+02:00</WarningDateTime>
</Warning>

... to which you can then subscribe to. ...然后您可以订阅。

This is - in my opinion - particularly useful if you have a single source of messages where each message is meant for another destination (eg different customers), or where the destination requires that each message is sent individually (eg a target invoice schema that allows only one invoice per file).在我看来,如果您有单个消息源,其中每条消息都针对另一个目的地(例如不同的客户),或者目的地要求单独发送每条消息(例如,目标发票模式允许每个文件只有一张发票)。

The alternative to this method would be to just select one record at a time from the source.此方法的替代方法是从源中一次只记录 select 一条记录。

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

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