Skip to main content

Pipelines Best Practices

  •  

Use the PassThruReceive and the PassThruTransmit standard pipelines whenever possible. They do not contain any pipeline component, and do not perform any processing of the message. For this reason, they ensure maximum performance in receiving or sending messages.

You can use a PassThruReceive pipeline on a receive location if you need to publish a binary document to the BizTalk MessageBox, and a PassThruTransmit pipeline on a send port if you need to send a binary message. You can also use the PassThruTransmit pipeline on a physical send port bound to an orchestration, if the message has been formatted and is ready to be transmitted. You will need to use a different approach, if you need to accomplish one of the following actions:

  • Promoting properties in the context of the inbound XML or Flat File message.
  • Applying a map inside the receive location.
  • Applying a map in an orchestration subscribing to the message.
  • Applying a map on a send port subscribing to the message.

To accomplish one of these actions, you must probe and discover the document type inside the receive pipeline and assign its value (namespace#root-name) to the MessageType context property. This operation is typically accomplished by a disassembler component as the Xml Disassembler component (XmlDasmComp) or the Flat File disassembler component (FFDasmComp). In this case, you need to use a standard (for example, XmlReceive pipeline) or a custom pipeline that contains a standard or a custom disassembler component.

In general, eliminate those components from your pipelines that are not strictly necessary. This will speed up message processing.
  •  
Inside a receive pipeline, you should promote items to the message context only if you need them for message routing (Orchestrations, Send Ports) or demotion of message context properties (Send Ports). If you need to flow metadata with a message, and you do not use them for routing or demotion purposes, use the IBaseMessageContext.Write method instead of the IBaseMessageContext.Promote method.
  •  
If you need to extract information from a message using an XPath expression, avoid loading the entire document into memory using an XmlDocument object just to use the SelectNodes or SelectSingleNode methods. For more information about these topics, see the "Performance Factors” section in the Microsoft BizTalk Server Performance Optimization Guide.