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.

We need to follow the below process to send exception details to BizTalk ESB
- Firstly we need to add bellow dlls in reference of the project. you can get these dlls in GAC

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

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);

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

5. Define Correlation Sets

6. Create a send port and assign exception message and initiate correlation set as define above.
7. Port Configuration should always be direct binding for this send port. As below screenshot.

Now build and deploy the application.

7 responses to “ESB Exception Handling in Orchestration”
[…] Click Here […]
LikeLike
[…] ESB Exception Handling in Orchestration by Vinay […]
LikeLike
[…] Go to following link: […]
LikeLike
Thanks for your valuable post
LikeLike
[…] ESB Exception Handling in Orchestration […]
LikeLike
[…] If you require also Exception Handling in Orchestration with ESB. Click here for how to achieve this. […]
LikeLike
[…] Exception Handling in orchestration […]
LikeLike