Using the Exception Management Framework

The ​Microsoft BizTalk ESB Toolkit uses exceptions to communicate failures (for example, a non-deployed map or rules that do not return a map name) for dynamic transformations and routing. When a transformation or routing process fails, the ESB creates an exception message and submits it through a direct-bound port to the Message Box database. The ESB also implements a send port named ALL.Exceptions that subscribes to and retrieves exception messages and publishes them to the ESB Management Portal.

In addition, all orchestration samples use the ESB Failed Orchestration Exception Routing API to handle exceptions. You can use this API in any orchestration project you deploy. The ESB Failed Orchestration Exception Routing feature provides a standard way to trap and report all exceptions in a BizTalk Server environment.

The ​Microsoft BizTalk ESB Toolkit contains several sample projects that demonstrate how to use the ESB Exception Management Framework. The following two projects encapsulate the ESB Failed Orchestration Exception Routing API:

  • ESB.ExceptionHandling. This project contains all the public methods for handling fault message processing in orchestrations. You must register the assembly in this project in the global assembly cache on the local server.

  • ESB.ExceptionHandling.Schemas.Faults. This project contains the fault message schema defined by the namespace **http://schemas.microsoft.biztalk.practices.esb.com/exceptionhandling** and the system property schema. You must deploy this project to the Microsoft.Practices.ESB application container.

    All projects that use the ESB Failed Orchestration Exception Routing API must reference the core assemblies:

  • Microsoft.Practices.ESB.ExceptionHandling.dll

  • Microsoft.Practices.ESB.ExceptionHandling.Schemas.Faults.dll

    The following sections provide more information about using the ESB Exception Management Framework:

  • The ESB Exception API Members

  • Creating and Publishing Fault Messages

  • Subscribing to and Extracting Messages

  • Scenario Solution Steps