ESB Exception Handling in Orchestration

In Orchestration when there is requirement is that all the exception should be logged into ESB Management Portal or ESB Exception Database, then we need to add some code in orchestration catch block to send exception to ESB Exception Db and Management Portal.

BizTalk Server Monitoring

We need to follow the below process to send exception details to BizTalk ESB

  1. Firstly we need to add bellow dlls in reference of the project. you can get these dlls in GAC
Dlls.jpg

2. Add exception massage in orchestration with  Message Type           Microsoft.Practices.ESB.ExceptionHandling.Schemas.Faults.FaultMessage     

EsbExceptionMessage.jpg

3.  In catch block create a message Assignment shape and write below code

ExceptionMsg = Microsoft.Practices.ESB.ExceptionHandling.ExceptionMgmt.CreateFaultMessage();

ExceptionMsg.FailureCategory = “SystemException”;

ExceptionMsg.FaultSeverity =  Microsoft.Practices.ESB.ExceptionHandling.FaultSeverity.Error;

ExceptionMsg.FaultCode =”1″;

ExceptionMsg.FaultDescription = systemException.Message.ToString(); 

Microsoft.Practices.ESB.ExceptionHandling.ExceptionMgmt.AddMessage(ExceptionMsg, ReceiveMsg);

ExpressionShapeDetails.jpg

You can change the message description according Business requirement. In last line AddMessage function contains Exception message first and then provide that message which you want to get from ESB Portal.

4. Create a Correlation type and corresponding correlation set with below property assign in correlation type:

  • Practices.ESB.ExceptionHandling.Schemas.Property.Application
  • Practices.ESB.ExceptionHandling.Schemas.Property.FaultCode
CorrelationProperties.jpg

5. Define Correlation Sets

Correlation.jpg

6. Create a send port and assign exception message and initiate correlation set as define above. SendPortConfiguration.jpg

    7. Port Configuration should always be direct binding for this send port. As below                  screenshot.

PortConfuguration.jpg

Now build and deploy the application.

BizTalk Server Monitoring

7 responses to “ESB Exception Handling in Orchestration”

  1. […] ESB Exception Handling in Orchestration  by Vinay […]

    Like

  2. Thanks for your valuable post

    Like

  3. […] ESB Exception Handling in Orchestration […]

    Like

  4. […] If you require also Exception Handling in Orchestration with ESB. Click here for how to achieve this. […]

    Like

Leave a comment