Microsoft BizTalk Server is the middleware to handle the large volume of business transactions on daily basis. The smooth functioning of business transactions is the focus of BizTalk Administrators, developers, and operators. At times, transactions are interrupted due to errors in the BizTalk Server’s infrastructure, and BizTalk Application components such as orchestrations, custom pipeline components and schemas.
In this article, let us see the best practices for exception handling in BizTalk Server.
Handling the exception is an art to cover all the possible components in which failure can occur. If the exception is not handled in the BizTalk Application, it impacts the BizTalk performance. Whenever the BizTalk failure happens, subsequently the messages are suspended in the message box. If the volume of transactions is high in the integration, BizTalk Host gets into the throttled state. This situation will impact the process of business transactions.
To avoid this situation, BizTalk components must be well-equipped with necessary exception-handling mechanisms. The events that cause the message failure is dependent upon the location of the failure and the status of failed message routing and recoverable interchange processing.
It is important to handle port-level failures. During the process of messages, if any exceptions occur at any stage of transactions, the messages get into Suspend instances in BizTalk Admin Console. When the transaction fails, an error message is generated with the processed message. BizTalk Message box promotes the error report with message context properties and demotes the original message context properties before publishing the failed message in suspended service instances.
Stack holders of business will be keen to receive alerts for the failed transaction with detailed information of the error description. To handle the exception at the port level
Enable the failure routing at the Receive Port and Send Port so that failed messages are routed to the ALL Exceptions in ESB Application. In the ESB portal, users can edit the messages and resubmit the message back to BizTalk Message Box.
ESB Exception management can handle the messages of different endpoints
For BizTalk users who does not use ESB Tool Kit, they can enable the Tracking of Message Content and context properties at port level, pipeline, and schema. This option is tricky to have, it has an impact on SQL Server resources if tracking has enabled for all the business transactions. Based on business needs users can enable tracking for important business integration.
Note: Enabling the tracking has an impact on performances, BizTalk Administrators can configure DTA Purge jobs to reduce the growth of tracking data.
In orchestration flow, if any exception occurs, it means, it is interrupting the business process and the reason for the interruption is not visible. To catch the exception in orchestration, Add the Catch Exception shape.
To avoid this situation, set up the catch exception shape to handle various kinds of exceptions. On the catch exception handler, specify the type of the exception, which must be either a fault message or an object derived from the class System.Exception.
It’s good practice to handle the exception gracefully whenever calling WCF services with a Catch Exception. Details about Handling the exception WCF services are explained in this article. After the number of retries in orchestration messages would get to the Suspended (Resumable) state. Configure the send port to catch that exception with filter conditions.
ErrorReport.ErrorType == “FailedMessage” AND ErrorReport.OutboundTransportLocation == “<Orchestration’s default catch exception handler is like writing a try-catch block in C# without the exception. This option handles the exception gracefully, not throwing the error description back to the processing mechanism.
Let us see the scenarios of handling the delivery failure exception in detail.
BizTalk360 is the one-stop solution for Microsoft BizTalk Server to administrate, monitor and visualize analytics data of the BizTalk environment. The application addressed the core challenges of the BizTalk Admin console
BizTalk360 has a bunch of features to administrate, monitor and view analytics data to handle the BizTalk exceptions in a better way.
Handling the exception in BizTalk Server has the complexity for understanding what is going wrong. It is handy to have a tool like BizTalk360 in your BizTalk environment that provides insight and monitors the sequence of the exceptions.
We have always heard feedback from users, if you have any feature requests or enhancements submit them in the BizTalk360 feedback forum. If you want to try out the BizTalk360 download the MSI.