BizTalk Pipeline Questions & Answers

What is pipeline and what is its use?

Pipeline is important part of BizTalk server in message processing. It is a component of Microsoft BizTalk Server that provides an implementation of the Pipes and Filters integration pattern. In pipeline level we can do several activities before sending to Messagebox.

Following activity can be applied in Pipeline:

  • Conversion from another format to XML vice-versa
  • Process encoded document (MIME/SMIME)
  • Breaking incoming document into separate individual documents
  • Modify message
  • Verifying or signing document with digital signature

For more details click here

Custom pipeline, why require custom pipeline?

Microsoft provides lots of feature in BizTalk Pipeline with having inbuild pipeline components. E.g. JSON Encoder, Decoder, MIME/SMIME Decoder etc. But sometimes we need add something in context of message then we need to do customization in pipeline, BizTalk provides the facilities to customize with help of Custom pipeline. 

Below are few scenarios where you need to apply Custom Pipeline

  • Conversion from another format to XML vice-versa
  • Add namespace (this facility is existed in BizTalk pipeline, when use ESB pipelines)
  • Promote message context property on custom data
  • Set dynamic send port
  • Message archiving
  • Handling large message

For More details Click here

What are Custom pipeline interfaces?

Below are mail interfaces:

  • IBaseComponent
  • IComponent
  • IComponentUI
  • IPersistPropertyBag
  • IAssemblerComponent
  • IDisassemblerComponent
  • IProbeMessage

For More details Click here

How to promote properties in custom pipeline?

IBaseMessage.Context.Promote(“MyPropertyName”, “http://MyPropertyNamespace, “MyValue”);

  • 1st Argument is PropertyName
  • 2nd Argument is namespace of Property schema.
  • 3rd Argument is the value to be set

If you use Context.Write the values will be written to the message context they will be available only in Orchestrations for reading and modifying however they will not be available for using in filter expression on send ports and orchestration receive message.  

Read Properties:

string srcFileName = System.String.Empty;

object propVal = messageContext.Read(“ReceivedFileName”, “http://schemas.microsoft.com/BizTalk/2003/file-properties);

if (propVal != null)

{ srcFileName = (System.String) propVal;

// …. add the rest of your code here…

}

How to call pipeline in orchestration?

There could be several reason to call pipeline in orchestration. And here in once scenario – requirement of assemble the message before sending to send port. BizTalk doesn’t provide the message assemble by default. best example you can studly composed message process from BizTalk design pattern.

In this design pattern we receive file in bach or multiple file at a time then debatch this file into multiple files and also before sending to send port its assemble all files into single file.

If you have already installed BizTalk on your server then you will get sample code at below location:

C:\Program Files (x86)\Microsoft BizTalk Server 2016\SDK\Samples\Pipelines\ComposedMessageProcessor

Composed Message Processor is the pattern of processing individual items from an aggregated or batched interchange message. For an example of this pattern, see CMP.odx in Composed Message Processor (BizTalk Server Sample).

Recoverable Interchange Processing or how to handle fault message while de-batching in receive pipeline?

This property is used to let you decide whether to suspend an entire batch of messages if at least one de-batched message fails in the disassemble or whether to allow the valid messages to be published and to suspend only the failed messages.

Click here for details

How to validate schema? OR Use of validation stage of receive pipeline component

BizTalk validates incoming message with defined schema in validate stage in receive pipeline.

A pipeline component processes only messages that conform to the schemas specified in that component. If a pipeline receives a message whose schema is not associated with any component in the pipeline, that message is not processed. Depending on the adapter that submits the message, the message is either suspended or an error is issued to the sender. Components in this stage are used to validate the XML messages produced by the Disassemble stage. Components in this stage specify schemas to perform the XML validation. This stage can contain between zero and 255 components.This stage may be run more than once. It runs once per message created by the Disassemble stage.

How to handle large message processing?

In my experience, solutions that must process large messages from end to end tend to be fairly rare. Generally, large input files can be de-batched by a receive pipeline into smaller discrete messages. This de-batching removes the need to worry about a large message and enables processing to be parallelized. in below reference Microsoft suggest Large message threshold setup for this activity.

Reference: https://docs.microsoft.com/en-us/biztalk/core/how-biztalk-server-processes-large-messages

If there is required only transfer large message without any modification or business logic. then you can create custom pipeline at decode stage in receive pipeline and send directly from that custom pipeline and return null in execute method, so that this message will not processed further to Messagebox database.

What is the functionality of disassembler stage of pipeline?

  1. This stage is used for components that parse or disassemble the message.
  2. Disassembler are designed to produce zero or multiple messages based on the input message.
  3. The components within this stage probe the message to see if the format of the message is recognized.
  4. This stage should include any custom components that implement special behavior to disassemble the message contents.
  5. The disassembler is responsible for promoting the message type of the message.
  6. Any custom property promotion occurs in disassembler stage.
  7. De-batching the enveloped message into several individual message.
  8. BizTalk provides out of box support for xml & flat file de-batching. This stage can contain between zero and 255 components.
  9. If there are no components in the stage, the message is passed through.

Send pipeline components’ s details

Send pipeline is specified on send port. this have specific stages that are related to preparing the message to be sent out of BizTalk A send pipeline is responsible for processing documents before sending them to their final destinations. The send pipeline takes one message and produces one message to send. for more details click here

Is there an error handling functionality to handle error on pipelines?

Yes. Error-handling functionality called error reporting which enables handling pipeline errors. Error reporting is specified on receive and send ports within the BizTalk Administration console. For more details click here.

Why attributes are added to class while developing a custom component?

To indicate that the component is a custom pipeline component and in which stage it can be used, couple of attributes are added to the class. 

  • [ComponentCategory(CategoryTypes.CATID_PipelineComponent)] —  This attribute tells that the component is custom pipeline component
  • [ComponentCategory(CategoryTypes.CATID_Any)]                           — This attribute tells that the component can be used at any stage
                                            OR
  • [ComponentCategory(CategoryTypes.CATID_DisassemblingParser)]  — This attribute tells that the component can be used only on Disassemble stage


Note: Regarding Resolve Party stage question will ask when interviewer is using in the project or there will be require in project.

Below links are available for other segment of Interview questions and Answers:

BizTalk Server Monitoring

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: