Tuesday, September 1, 2009

Consistent and unified error handling in Biztalk 2006

To provide your solution an unified and consistent treatment of exception handling in biztalk 2006 these factors must be fulfilled or at least looked into.

• Standardize how application exceptions are detected and caught in the BizTalk envi-
ronment, i.e., messaging and orchestration subsystems.
• Provide common patterns that allow automated processes to react and manage appli-
cation exceptions.
• Provide a loosely coupled exception management pattern that facilitates reuse.
• Develop a common reporting paradigm of application exceptions and their available
message state that applies to any BizTalk subsystem.

The first important thing you have to do is enabling "Enable routing for failed messages" on receive port. The consequence is that instead of suspending the message the message will be published and a several properties will be promoted to the message context.


Now we have the ability to subscribe on all errormessages using System.Xml.XmlDocument for message type and evaluating the property ErrorType in namespace ErrorReport:

If orchestration Activate==true and Filter expression like:
(ErrorReport.ErrorType == "FailedMessage")
If filter on send port:
(ErrorReport.ErrorType == FailedMessage)

email: robert.sodergren@gmail.com