Pipelines are implemented in a BizTalk 2004/2006 project for a variety of reasons, including encryption/decryption, splitting single XML documents into multiple documents, and converting flat files into XML documents etc. For doing above mentioned tasks we’ll be using Pipeline components (which gets deployed in different stages of a pipeline). For more information about Pipeline and pipeline components visit here
This post intends to cover the BizTalk pipeline related questions, which a BizTalk developer can face during an interview.
Questions and answers:
1.Why do we need a custompipeline when we have default pipelines?
BizTalk Server provides a few out of the box pipeline components. For instancethe S/MIME components for encrypting or decrypting messages. In case you needto do some pre or post processing on a message and the functionality is notoffered through the provided pipeline components you will needto built your own custom pipeline component. The pipelinecomponent(s) can then be used within a custom pipeline.See alsoTechNet Wiki Article BizTalk: List of Custom Pipeline Components.
2.What is the maximum messagesize supported by XML send an XML receive pipeline?
This depends on infrastructure specifications (CPU, Memory, Disk) and onspecific (possible) bottlenecks in your Microsoft BizTalk Server system (seeMSDN How BizTalk Server Processes Large Messages ).While BizTalk Server imposes no restriction on message size, practical limitsand dependencies might require you to minimize the size of your messagesbecause large messages require more processing resources (see MSDN MessageConsiderations ).
3.What is the minimum number of componentsallowed in pipeline stage?
Minimum is zero components, example PassThru pipeline.
4.What is the maximum number of componentsallowed in pipeline stage?
All stages in the pipeline can take maximum of 255 components, except theassemble stage that has a maximum of one.
5.Does Flat file assembler pipeline componentvalidates the incoming XML message?
.btp file is a BizTalk Server pipeline file.
7.How many states havethe Receive Pipelines and the Send Pipelines?
oDecode Stage: This stage is used for components that decode or decrypt themessage.
oDisassemble Stage: This stage is used for components that parseor disassemble the message.
oValidate Stage: This stage is used for components thatvalidate the message format.
oResolve Party Stage: This stage is a placeholder for the PartyResolution Pipeline Component.
Regarding to the send pipelines, they consist of three stages:
oPre-assemble Stage: This stage is a placeholder for customcomponents that should perform some action on the message before the message isserialized.
oAssemble Stage: Components in this stage are responsible forassembling or serializing the message and converting it to or from XML.
oEncode Stage: This stage is used for components that encode or encrypt themessage.
8.Is there any VisualStudio Wizard to create custom pipeline components?
Yes there is. The Pipeline Component Wizard is intended to ease development ofpipeline components used within a BizTalk Server environment. Supports both C#and VB.NET. See more here .
9.What's the difference between DefaultPipelines and Custom Pipelines?
When you create a new application, the default pipelines are created anddeployed by default and appear in the Microsoft.BizTalk.DefaultPipelinesassembly in the References folder for every BizTalk project. The defaultpipelines cannot be modified in Pipeline Designer. These pipelines can beselected when configuring a send port or receive location in BizTalk Explorer.
Pipelines and pipeline components present out of the box can do most of thetasks for you. But sometime specific message processing or messagingrequirements encourage developers to develop custom pipeline components. Youcan create three types of pipeline components: general, assembling, anddisassembling. Each of the three types can additionally implement probingfunctionality. Each type of pipeline component has an associated interface thatmust be implemented for the component to be plugged into the BizTalk MessagingEngine; the pipeline interfaces that distinguish the types of componentsare IComponent, IAssemblerComponent, and IDisassemblerComponent. A custompipeline component is just a plain .NET class that implements several BizTalkinterfaces.
10.Is there an error handling functionality tohandle error on pipelines?
Yes. Error-handling functionality called error reporting which enables handlingpipeline errors. Error reporting isspecified on receive and sendports within the BizTalk Administration console.
11.When is filter used to create a subscription?
Filters are used to create subscription when orchestrations are not part of thescenario.
12.Which property is required when using Flatfile Disassembler component?
Setting the Document Schema property is required, all other properties areoptional.
13.What if Document Schema property is notspecified when using Flat file Disassembler component?
A runtime schema discovery will be attempted, Biztalk Server attempts todetermine the correct flat file schema to assemble the message with, based onthe namespace and the root node of the message.
14.Which API is used to implement Pipeline?
To implement pipelinewe have to use the API in the Microsoft. BizTalk.Component. Interop namespace.
15.What are types of pipeline components?
oAssembling
oProbing
16. Why attributes are added to class while developing a customcomponent?
To indicate that the componentis a custom pipeline component and in which stage it can be used, couple ofattributes are added to the class.
[ComponentCategory(CategoryTypes.CATID_PipelineComponent)] -- Thisattribute tells that the component is cutom pipeline component
[ComponentCategory(CategoryTypes.CATID_Any)] -- This attribute tells that the component can be used at any stage
[ComponentCategory(CategoryTypes.CATID_DisassemblingParser)] --This attribute tells that the component can be used only on Disassemble stage
17. Custom Component is notvisible in Toolbox, even after adding the assembly to GAC?
Just adding assemblyis not sufficient, it needs to be added to component dll atlocation : C:Program FilesMicrosoft BizTalk Server
2010PipelineComponents and thenreset the toolbox, it will be visible and ready to use.
18. What interfaces are used in developing ageneral custom pipeline component?
IBaseComponent,IComponentUI,IComponent,IPersistPropertyBag
19. What interfaces are used in developing acustom dis-assembler component?
IBaseComponent,IComponentUI,IDisassemblerComponent,IPersistPropertyBag
20. What interfaces are used in developing acustom assembler component?
IBaseComponent,IComponentUI,IAssemblerComponent,IPersistPropertyBag
21. What interfaces are used in developing acustom Probing component?
We need to follow certain procedures before the component get used by Biztalk. They are
1. After building the pipeline component in visual studio, the dll needs to be copied to the location “C:Program FilesMicrosoft BizTalk Server 2006Pipeline Components” (or 2004).
Reasons for that (a) Visual Studio designer will pick up the dll from this location, so you can add them to the visual studio tools, while creating Pipelines. (2) When you start the Biztalk service the “dlls” will be loaded into the host instance (BTSNTSVC service) from this location. and (3) When an isolated host is started (by receiving messages via isolated host instance, i.e HTTP and SOAP adapter) W3WP service load the pipeline component from this location.
2. Since the dll is loaded by Visual Studio (if you have opened a Pipeline Project), BTSNTSVC Service and/or W3WP, you need to stop the BTSNTSVC service, IISRESET and close Visual Studio project (Pipelines development) before copying the dll to the location “C:Program FilesMicrosoft BizTalk Server 2006Pipeline Components” (or 2004).
3. After copying you need to start the BTSNTSVC service.
4. The external components referenced within a pipeline components needs to be deployed in the GAC (Uninstall prior to installation is good).
To do the above steps each time when we make a change will end up as an annoying thing over the development period.
We can cut down some of the steps using the following steps.
1. Create a separate project for pipeline components and the external assemblies its referencing to. Don’t put the pipeline components along with the solution which has Pipelines project (please note Pipelines and pipeline components are two different things)
2. Within Visual Studio, On the pipeline components project, right-click on the project, go to properties, select “Build Events” and click “Edit Post Build…” button. Copy the following script and click OK.
IF $(ConfigurationName) EQU Release GOTO done
xcopy “$(ProjectDir)$(Outdir)$(TargetFileName)” “C:Program FilesMicrosoft BizTalk Server 2006Pipeline Components” /R /Y /F IF %ERRORLEVEL% EQU 0 GOTO done net stop “BizTalk Service BizTalk Group : BizTalkServerApplication” iisreset xcopy “$(ProjectDir)$(Outdir)$(TargetFileName)” “C:Program FilesMicrosoft BizTalk Server 2006Pipeline Components” /R /Y /F net start “BizTalk Service BizTalk Group : BizTalkServerApplication” :done
3. On the external components project referenced by pipeline components, put the following script.
“C:Program FilesMicrosoft Visual Studio 8SDKv2.0Bingacutil.exe” /i “$(TargetPath)”
The scripts are quite straight forward, all it does is copies the dll to the correct location, if it gets some sharing violation it slops, BizTalk, IIS and tries again to copy the dll. On the 3rd step it reinstalls the referenced assemblies in the GAC.
The only manual thing you need to do is, close the Visual Studio Pipeline (not pipeline component) project, referencing the pipeline component under development.
I’m sure this will help developers quite a lot of time during pipeline component development.
useful links:Pipeline Component Wizard
This blog is to explain how to handle below requirements in BizTalk Receive Pipeline.
Let’s discuss these points.
By default, BizTalk Receive Pipeline Json Decoder can convert the Json message to Xml message.
Example:
{
“ForeignTax”: 12.5,
“AdditionalPremium”: 20
Biztalk Debug Pipeline Component
}
2. Handle List/Array json messages
By default, BizTalk receive pipeline Json Decoder cannot convert Array/List Json messages to Xml format.
Example:
[
{
“Id”: 94,
“LineOfBuinsinesses”: [
{
“Id”: 1,
“Description”: “abc”,
“Type”: 1
},
“Id”: 2,
“Description”: “def”,
“Type”: 2
},
{
“Id”: 3,
“Description”: “ghi”,
“Type”: 2
}
]
}
]
In order to handle this kind of json messages, we need to add one Root element to the message and this can be done using custom pipeline. You can download the custom pipeline code from below link.
We need to add this pipeline to Receive pipeline decode stage and deploy the application.
You need to supply the RootName parameters from Pipeline properties in BizTalk admin console.
In the above screenshot, you need to provide RootNode under Decode Stage.
After executing this receive pipeline Enhance JSON Stage, your json message looks like something below and this message can be handled by JSON Decoder.
{“Details”: [
{
“Id”: 94,
Pita bread production line for sale in florida. “LineOfBuinsinesses”: [
{
“Id”: 1,
Microsoft Biztalk Component
“Description”: “abc”,
Both personal and business channels are available. It works through the use of individual channels, similar to having a television on your computer.: It's easy to make your own YouTube channel to start sharing videos online. Learn more about this hub of entertainment and how to use it. My most visited sites. Learn how to take advantage of this far-reaching influencer.: YouTube is vast so finding what you want to watch isn't always easy.
“Type”: 1
},
{
“Id”: 2,
“Description”: “def”,
“Type”: 2
},
{
“Id”: 3,
“Description”: “ghi”,
“Type”: 2
}
]
}
]}
Also, you can use the same pipeline for both List and Non-List messages, only thing you have to do for Non-list message is that you no need to supply any Root parameter.
3. Remove special characters before Json Decoder pipeline stage
If you want to remove some special characters in the Json message, you can use some regular expression in the custom Pipeline code.
Example:
string invalidCodeRegEx = @”[][u][0-9]{4}|b”;
text = System.Text.RegularExpressions.Regex.Replace(text, invalidCodeRegEx, “”);
Advertisements
There is a interface IBaseMessageFactory that you can use to create instances of BizTalk messages and BizTalk message parts.You can grab a handle to an instance of a subtype of this interface from within the Dissassemble method using the IPipelineContext.GetMessageFactory(). An important thing to note is that in order to preserve the message context you must grab this from the original message and poke it into the new instances created by the factory. The following code illustrates it.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |