Custom Pipeline Components Development Best Practices

Listen with webReader
Published 02 January 08 12:05 AM | Johan Hedberg

There is much to be said about pipeline component development. Online, in the helpfiles, in books there are step by step guidance on how to build pipeline components of different types (Assembers, Dissassemblers, General Purpose etc.). I'm not going to repeat any of that. Instead I'm going to list the things that I feel are paramount to think about when doing pipeline component development, regardless of type of component and its purpose.

  1. As long as it's possible - keep it forward only streaming. Learn and know the contents and techniques of Microsoft.BizTalk.Streaming.dll.
  2. In case you can't keep it forward only, make sure you have a seekable stream, by wrapping it in such (ReadOnlySeekableStream), which in turns creates a VirtualStream that overflows to disk instead of filling up your memory.
  3. If the above streaming classes are not enough, and you need data from the stream, try to build your own Stream implementation and perform your logic as it is being read. Be a copycat, use Reflector.
  4. Do not load the contents of streams into memory. MemoryStream, XmlDocument, string and ReadToEnd and such is therefore generally a sign of bad practice. Keep your components impact on memory as low as possible.
  5. Don't start new threads - doing so interferes with BizTalks internal threadpool management and thus impacts performance.
  6. Try to stay away from database calls or calls to WebServices. If you must do them, be sure to cache the response if at all possible (and reasonable). Keep the pipeline lean and mean.
  7. Test. Test early, test often, test as a unit, test in conjuction with other components in a pipeline, test logic, test performance. And when testing, don't test on your development laptop and go "that seems to work fine", keep it real (as real as possible).

If you think of these things you'll be better off. There are still mistakes you can make doing BizTalk custom pipeline component develpment, and of course all general .Net coding best practices apply here as well, but if you think of these things, and can clearly motivate when and why you deviate from them, you're one step closer to a successful component implementation.

Comments

# Mikael Håkanssons Blog said on September 21, 2008 04:22 PM:

Also take a minute to read Johan's blog post about best practices when building pipeline components

# Be Logical - writings by Johan Hedberg said on January 6, 2009 09:00 AM:

So, a year passed. Year-end statistics are always fun. However I really need to make sure we have additional

# Microsoft AppFabric Customer Advisory Team said on June 21, 2010 08:40 PM:

It is widely known that custom pipeline components are highly popular extensibility points in the BizTalk

Leave a Comment

(required) 
(required) 
(optional)
(required) 

This Blog

News

    Messenger

    Twitter Updates

      Follow me on twitter

      Visitors

      Feedburner Subscribers

      Locations of visitors to this page

      Disclaimer

      All material is provided AS IS voiding any thinkable or unthinkable effect it might have for any use whatsoever. There... is that clear enough ;)

      Pages

    Syndication