Be.Stateless.BizTalk.Pipeline.MicroComponents
Build Pipelines
Latest Release
Release Preview
Overview
Be.Stateless.BizTalk.Pipeline.MicroComponents
is part of the BizTalk.Factory Runtime Package. This component provides various general purpose micro components meant to be run by the BizTalk.Factory
’s MicroPipelineComponent, see Be.Stateless.BizTalk.Pipeline.Components, Be.Stateless.BizTalk.Pipelines, Be.Stateless.BizTalk.Dsl.Pipeline, and Be.Stateless.BizTalk.Dsl.Binding for more information about micro pipelines.
Remark Being part of the
BizTalk.Factory Runtime
, this component’s deployment only requires its assembly to be GAC-deployed; it consequently has noBizTalkMgmtDb
footprint at all as it is not deployed as a Microsoft BizTalk Server® resource.
Micro Components
Be.Stateless.BizTalk.Pipeline.MicroComponents
comes with the following micro components:
-
Be.Stateless.BizTalk.MicroComponent.ContextBuilder which is a micro component that delegates the building of message context to a IContextBuilder component plugin, either statically configured or discovered at runtime thanks to the BizTalkFactoryProperties.ContextBuilderTypeName context property, whose execution can be deferred until the message body’s stream passing through is exhausted, see PluginExecutionTime;
-
Be.Stateless.BizTalk.MicroComponent.ContextPropertyExtractor which allows to manipulate the message context by either clearing, demoting, writing or promoting property values. These values can either be constant or extracted out of an
XML
message by definingXPath
expressions. TheseXPath
extractors can be statically configured at the pipeline or be embedded as annotations —see their grammar and an example— in theXML
schema of the message currently running through the micro component;Remark At first sight, it might seem that this
ContextPropertyExtractor
micro component is a complete overlap of what Microsoft BizTalk Server® offers out of the box, see Promoting Properties and Property Schemas. ThisContextPropertyExtractor
micro component however comes with real added value:-
First of all, context properties can be written into context and not just promoted;
-
Then, the allowed
XPath
expressions are somewhat less restrictive than the traditional canonicalXPath
expressions supported by Microsoft BizTalk Server®, but limitations are however still present and relatively strong; -
Finally, it circumvents an odd restriction requiring that the property schema associated with a message schema be in the same Microsoft BizTalk Server® project, —see note’s first bullet at Create property schema overview. On rare occasions, this restriction prevents a Microsoft BizTalk Server® solution from compiling and leaves the developers to their own devices as Microsoft won’t offer support for this scenario as stated clearly in the aforementioned note.
-
-
Be.Stateless.BizTalk.MicroComponent.DirectoryCreator which allows to create folders before the
FILE
adapter drops a message as a file on disk. It can even impersonate any Windows identity thanks to the credentials provided by theFILE
adapter configuration; -
Be.Stateless.BizTalk.MicroComponent.FailedMessageRoutingEnabler which enables routing of failed messages and prevents routing failure reports from being generated. The Be.Stateless.BizTalk.Component.FailedMessageRoutingEnablerComponent actually delegates to this micro component, see Be.Stateless.BizTalk.Pipeline.Components;
-
Be.Stateless.BizTalk.MicroComponent.MessageBodyStreamFactory which replaces the stream of the current message’s BodyPart by a new one whose creation is delegated to either a contextual, see BizTalkFactoryProperties.MessageBodyStreamFactoryTypeName context property, or statically configured IMessageBodyStreamFactory plugin;
-
Be.Stateless.BizTalk.MicroComponent.MessageConsumer which drains and consumes the pipeline’s message;
-
Be.Stateless.BizTalk.MicroComponent.MessageTypeExtractor which probes the current message for its type and write it in the BizTalkFactoryProperties.MessageType context property.
-
Be.Stateless.BizTalk.MicroComponent.MultipartFormDataContentEncoder which wraps the original message stream in a MultipartFormDataContentStream;
-
Be.Stateless.BizTalk.MicroComponent.SBMessagingContextPropagator which propagates outwards message type and correlation id over to Azure ServiceBus queued messages, and which propagates inwards correlation id from Azure ServiceBus queued messages;
-
Be.Stateless.BizTalk.MicroComponent.TransportRetriesDisabler which prevents Microsoft BizTalk Server’s SendPort Transport from performing any retries to send the message in case of failures;
-
Be.Stateless.BizTalk.MicroComponent.XmlEnvelopeDecoder which wraps the original message stream in a XmlEnvelopeDecodingStream to prevent the disassembler from throwing when some
XML
elements along the body XPath for envelope schemas are either missing or empty or self-closed, see BizTalk envelope schema self-closing node; -
Be.Stateless.BizTalk.MicroComponent.XmlTranslator which, on the fly, moves elements, and optionally attributes, from one
XML
namespace to another in theXML
stream constituting the body of the message. The namespace translation to be made can either be statically configured or be discovered at runtime thanks to the BizTalkFactoryProperties.XmlTranslations context property; -
Be.Stateless.BizTalk.MicroComponent.XsltRunner which applies an
XSLT
Transformation onXML
messages along their way in the pipeline; don’t forget to check the section CompiledXSLT
Transforms on Steroids for an overview of the distinctive features ofBizTalk.Factory
. The map can either be statically configured or discovered at runtime thanks to the BizTalkFactoryProperties.MapTypeName context property; -
Be.Stateless.BizTalk.MicroComponent.ZipDecoder which wraps the message’s original stream in a ZipInputStream that decompresses the first entry of a Zip Archive;
-
Be.Stateless.BizTalk.MicroComponent.ZipEncoder which wraps the message’s original stream in a ZipOutputStream that compresses it into a Zip Archive.
Builder Plugins
Be.Stateless.BizTalk.Pipeline.MicroComponents
comes with the following IContextBuilder plugins:
-
FileOutboundTransportLocationBuilder which computes the final destination path —folder path and file name— to be used by the
FILE
adapter on the basis of the destination folder configured at the adapter level —i.e. the configured destination folder without the file name— combined with the folder path and file name found in the context property BizTalkFactoryProperties.OutboundTransportLocation; -
SftpOutboundTransportLocationBuilder which computes the final destination URI — server address, folder path, and file name— to be used by the
SFTP
adapter on the basis of the server address and folder path configured at the adapter level —i.e. the configured folder path without the file name— combined with the folder path and file name found in the context property BizTalkFactoryProperties.OutboundTransportLocation.
Developing and Testing Custom Pipeline Micro Components
- Be.Stateless.BizTalk.Pipeline.MicroComponents.Unit
- Be.Stateless.BizTalk.Pipeline.MicroComponents.NUnit
- Be.Stateless.BizTalk.Pipeline.MicroComponents.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: