Skip to the content.

Be.Stateless.BizTalk.Pipeline.Components

Build Pipelines

Latest Release

Release Preview

Overview

Be.Stateless.BizTalk.Pipeline.Components is part of the BizTalk.Factory Application Package. This component provides very lightweight yet tremendously helpful Microsoft BizTalk Server® pipeline components. It is accompanied by a set of unit-testing helper components meant to support the developer in writing custom pipeline components and their unit tests.

Be.Stateless.BizTalk.Pipeline.Components

All this component provides are 3 seemingly insignificant classes:

Remark Be.Stateless.BizTalk.Pipeline.Components component is part of the BizTalk.Factory Application, which is deployed as a full-fledged Microsoft BizTalk Server® application, and it cannot consequently be redeployed without first unenlisting or undeploying any other Microsoft BizTalk Server® applications that depends on it. That would inevitably lead to downtime and operational overheads, but due to their very generic or mediating implementations, these pipeline components should never require a complete redeployment —at worst, a new GAC deployment on rare occasions.

Using and Configuring the MicroPipelineComponent

Besides the fact that, thanks to MicroPipelineComponent, developers no longer need to constantly define and deploy custom Microsoft BizTalk Server® pipelines, what the real added value this pipeline component brings forward is that it can easily be entirely reconfigured without any downtime nor any deployment or administrative restriction. Noticeably, extending, rearranging, or reducing the series of micro components that a given MicroPipelineComponent instance will run can trivially be accomplished through the Microsoft BizTalk Server® administration console, what is impossible to achieve with traditional Microsoft BizTalk Server® pipelines.

That being said, coming with the right value to feed to the MicroPipelineComponent’s Components property, which is of type IEnumerable<IMicroComponent>, through the Microsoft BizTalk Server® administration console might not be trivial. Internally, this property serializes itself as an XML string that encompasses the XML serialization of its micro components; see the following example. Notice also that to feed this XML string through the Microsoft BizTalk Server® administration console, it must be a one liner!

<mComponents>
    <mComponent name='Be.Stateless.BizTalk.MicroComponent.ContextPropertyExtractor, Be.Stateless.BizTalk.Pipeline.MicroComponents, Version=2.1.0.0, Culture=neutral, PublicKeyToken=3707daa0b119fc14'>
        <Extractors />
    </mComponent>
    <mComponent name='Be.Stateless.BizTalk.MicroComponent.ContextBuilder, Be.Stateless.BizTalk.Pipeline.MicroComponents, Version=2.1.0.0, Culture=neutral, PublicKeyToken=3707daa0b119fc14'>
        <Builder>Be.Stateless.BizTalk.Dummies.Bindings.DummyContextBuilder, Be.Stateless.BizTalk.Dsl.Binding.Dummies, Version=2.1.0.0, Culture=neutral, PublicKeyToken=3707daa0b119fc14</Builder>
        <ExecutionTime>Deferred</ExecutionTime>
    </mComponent>
    <mComponent name='Be.Stateless.BizTalk.MicroComponent.ActivityTracker, Be.Stateless.BizTalk.Activity.Tracking, Version=2.1.0.0, Culture=neutral, PublicKeyToken=3707daa0b119fc14'>
        <TrackingContextCacheDuration>00:01:00</TrackingContextCacheDuration>
        <TrackingModes>Context</TrackingModes>
    </mComponent>
    <mComponent name='Be.Stateless.BizTalk.MicroComponent.XmlTranslator, Be.Stateless.BizTalk.Pipeline.MicroComponents, Version=2.1.0.0, Culture=neutral, PublicKeyToken=3707daa0b119fc14'>
        <Encoding>utf-8</Encoding>
        <Modes>Default</Modes>
        <Translations override='false'>
            <NamespaceTranslation matchingPattern='.*' replacementPattern='urn:schemas.stateless.be:biztalk:claim:2017:04'
                xmlns='urn:schemas.stateless.be:biztalk:translations:2013:07' />
            <NamespaceTranslation matchingPattern='^urn:dummy:2021:11:11$' replacementPattern='urn:schemas.stateless.be:biztalk:claim:2017:04'
                xmlns='urn:schemas.stateless.be:biztalk:translations:2013:07' />
        </Translations>
    </mComponent>
</mComponents>

If developers had to manually craft these XML by hand, the use of the MicroPipelineComponent pipeline component would be subject to a severe impairment. To circumvent this issue, BizTalk.Factory comes with a C# embedded DSL that allows developers to write the previous configuration entirely in a type safe C# way, as the following excerpt demonstrates:

... new ReceivePipeline<PassThruReceive>(pl => pl.Decoder<MicroPipelineComponent>(c => {
    c.Components = new IMicroComponent[] {
        new ContextPropertyExtractor(),
        new ContextBuilder {
            ExecutionTime = PluginExecutionTime.Deferred,
            BuilderType = typeof(DummyContextBuilder)
        },
        new ActivityTracker {
            TrackingModes = ActivityTrackingModes.Context
        },
        new XmlTranslator {
            Translations = new() { Items = new XmlNamespaceTranslation[] {
                new() {
                    MatchingPatternString = ".*",
                    ReplacementPattern = SchemaMetadata.For<Claim.CheckOut>().TargetNamespace
                },
                new() {
                    MatchingPatternString = "^urn:dummy:2021:11:11$",
                    ReplacementPattern = SchemaMetadata.For<Claim.CheckIn>().TargetNamespace
                }
            }}
        }
    };
}));

Notice that this code is what is actually used at deployment time by BizTalk.Factory to generate the Microsoft BizTalk Server® XML application bindings to import. For further explanation, the developer is invited to browse the documentation and features offered by Be.Stateless.BizTalk.Dsl.Binding and Be.Stateless.BizTalk.Dsl.Pipeline.

Remark Out of the box, BizTalk.Factory provides a versatile set of pipelines hosting this MicroPipelineComponent pipeline component, see Be.Stateless.BizTalk.Pipelines, as well as a bunch of reusable micro components providing a whole wealth of services, see Be.Stateless.BizTalk.MicroComponents.

MicroPipelineComponent Implementation

It is worth noticing that MicroPipelineComponent itself delegates its implementation to a pseudo —because it does not implement the IMicroComponent interface— micro component, i.e. MicroPipeline, that comes with the same GAC-only deployment constraints as all the components being part of the BizTalk.Factory Runtime Package. Even the serialization of the micro components declared at the MicroPipelineComponent level is taken care of by the pseudo micro component MicroPipeline; it would therefore be possible, for instance, to change the serialization format from XML to anything else without any deployment impact on Microsoft BizTalk Server® other than a reconfiguration of the pipelines of all the receiving locations and sending ports defined in Microsoft BizTalk Server® that depend on the MicroPipelineComponent pipeline component.

Developing and Testing Custom Pipeline Components

  1. Be.Stateless.BizTalk.Pipeline.Components.Unit
  2. Be.Stateless.BizTalk.Pipeline.Components.NUnit
  3. Be.Stateless.BizTalk.Pipeline.Components.XUnit

Developer Help

Detailed developer help has been provided as XML comments directly embedded in source code. Though developers usually browse through this documentation while developing thanks to, for instance, JetBrains ReSharper quick help —ctrl+shift+F1, an online version of this inlined help has also been provided here for greater reachability: