BizTalk Exception Management

Tags:

The latest publication of BizTalk Hotrod Magazine is available and can be downloaded. The topics in this issue covered are:

• BizTalk Exception Management
• Exposing Business Rules Engine Policies as WCF Services
• Tools of the Trade
• Parallel Convoys in BizTalk
• A Glimpse of the BizTalk Server 2006 R2 WCF Adapters
• Smart Use of XSLT BizTalk
• In the beginning
• What’s Under that Hood?

I have read this edition and found the BizTalk Exception Management Application is a great article. It walks you through an enterprise BizTalk Exception Management application based upon the Patterns and Practices ESB Exception Management Framework. If you have ever thought about using the ESB Exception Management Framework, this article serves as a great primer.

So I started experimenting with this Framework, not in a BizTalk 2006 R2 environment, but just BizTalk Server 2006. In my environment I had Microsoft Windows 2003 Standard Edition SP2 OS, 1,6Ghz processor and 512 Mb of RAM. It had Office, Visual Studio 2005 and SQL Server 2005 installed. Here I download Patterns and Practices ESB Guidance 1.0 November 2007. Then I took one of the examples from the SDK like HelloWorld orchestration (\Program FilesMicrosoft BizTalk Server 2006SDKSamplesOrchestrationsHelloWorld) and added scope and exception.

I wanted to find out how to publish the message simply to file as an experiment.

Code inside assign values shape:
//Construct a new Fault Message
FaultMessage = Microsoft.Practices.ESB.ExceptionHandling.ExceptionMgmt.CreateFaultMessage();
//Assign values
//FaultMessage(Microsoft.Practices.ESB.ExceptionHandling.Schemas.Property.Application)= “HelloWorld”;
FaultMessage.FailureCategory = “MessageBuild”;
FaultMessage.FaultCode = “NNNN”;
FaultMessage.FaultDescription = “Some error occured”;
FaultMessage.FaultSeverity = Microsoft.Practices.ESB.ExceptionHandling.FaultSeverity.Severe;
FaultMessage.Scope = “Execution Scope”;
//Add suspended message (SourceMessage) to the FaultMessage
Microsoft.Practices.ESB.ExceptionHandling.ExceptionMgmt.AddMessage(FaultMessage,POMessage);
//Add the exception from the exception handler to the FaultMessage
Microsoft.Practices.ESB.ExceptionHandling.ExceptionMgmt.SetException(FaultMessage,ex);

To create an error inside the orchestration I created two variables and let a divide by zero error occur:

//Generate divide by zero exception
y=0;
x = 1/y;

When I tested it it finally resulted in a message inside a folder. Message looked like this.

Well that worked, so I am going to look into it some more. ESB Guidance package is intended for BizTalk Server 2006 R2, but Exception Management part can be implemented in BizTalk Server 2006 enviroment.

Technorati:

Author: Steef-Jan Wiggers

Steef-Jan Wiggers is all in on Microsoft Azure, Integration, and Data Science. He has over 15 years’ experience in a wide variety of scenarios such as custom .NET solution development, overseeing large enterprise integrations, building web services, managing projects, designing web services, experimenting with data, SQL Server database administration, and consulting. Steef-Jan loves challenges in the Microsoft playing field combining it with his domain knowledge in energy, utility, banking, insurance, healthcare, agriculture, (local) government, bio-sciences, retail, travel, and logistics. He is very active in the community as a blogger, TechNet Wiki author, book author, and global public speaker. For these efforts, Microsoft has recognized him a Microsoft MVP for the past 8 years.

BizTalk360
BizTalk Server

Over 650+ customers across
30+ countries depend on BizTalk360

Learn More
Serverless360
Azure

Operate efficiently with enterprise-grade Azure monitoring,
tracing, remediation & governance in one platform

Learn More

Back to Top