BizTalk exception handling best practices 

The complete guide to handling exceptions in BizTalk Server

Key Takeaways:

  • Handling the exception in BizTalk Server
  • Port level exception
  • ESB (Enterprise Service Bus) exception management framework
  • How do you handle exceptions in BizTalk orchestration?
  • Get started with the new release of BizTalk360 v10.4 today!

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 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.

Port level Exception Handling

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

  • Handle the routing failure exceptions in the ESB Exception framework
  • Track the error message in the BizTalk Tracking database

ESB Exception Management

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

  • HTTP Receive Location 
  • WCF Onramp
  • Soap Onramp
  • Itinerary WCF Onramp
  • Itinerary SOAP Onramp
  • Tracked Services Instances

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.

How do you handle exceptions in BizTalk orchestration?

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.

BizTalk exception handling best practices

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.

Handling the SOAP Exception in Orchestration

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 == “<>”

Handling the Delivery Failure Notification

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.

  • The messages are not transmitted to Send Port without the property of Delivery Notification with “Transmitted”
  • Bind the Retry Count = 0 in Send Port request-response port configuration
  • The enhanced custom Catch Exception handler captures the error description of “Microsoft.XLANGs.BaseTypes.DeliveryFailureException” exception

Get started with the new release of BizTalk360 v10.4 today!

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

  • Avoid context switching between the multiple tools to administrate the BizTalk components
  • Fine-grained user access policies
  • Governance & Audit
  • Monitoring covers the Platform, BizTalk Applications, Queues and External Endpoints.
  • In Analytics visualize Performance, BizTalk Transactional and Tracking data
  • Enriched Knowledge Base

BizTalk360 has a bunch of features to administrate, monitor and view analytics data to handle the BizTalk exceptions in a better way.

Administration

  • BizTalk Administrator is focusing on the health and performance of the BizTalk environment. The features will help them to better understand the cause of the exception and action them with enhanced features in BizTalk360.
  • Advanced Event Viewer – The administrator can configure the desired event Sources that BizTalk360 windows service will collect from BizTalk and SQL Server. If an error or failure happens on different servers, the administration team must manually log in to each server to check the root cause of the problem. Advanced event viewer has rich filter capabilities and saved queries.
  • Graphical Message Flow – In BizTalk360, users can visualize the flow of messages with the interactive point to point in feature Graphical message flow. This feature will highlight the message flow and indicate the stage of failure. Messageflow
  • ESB Exception Management – The integrated ESB portal has improved exception handling with configurable endpoints and HTTP receive location for the message resubmission. In the ESB exception framework, users can view, edit and resubmit the fault messages to the BizTalk Message box. BizTal exception handling best practices

Monitoring

  • Data monitoring is a powerful capability to monitor the transaction of business processes with a daily, weekly, and monthly schedule. Users can visualize the status of each schedule in a calendar view of types of monitoring like File process monitoring, Suspended Service Instances, Tracked Service Instances, Event Log, BAM etc.,
  • Suspended Service Instances (Data monitoring) is the key feature to take automatic actions on Resumable Suspended Instances to either resume/terminate in case of any routing failure or any exception occurs.
  • Event log data monitoring is a handy feature for administrators to know the important failure in BizTalk and SQL Server. It will alert the users with sources and error descriptions of event logs.

Analytics

  • Analytics widgets: Transmission Failure Rate Whenever the transmission of messages failing during the processing, BizTalk Tracking Message Events capture this event under the Transmission Failure event type. The user can visualize the failure events in the Analytics widgets group by Ports and Schemas. BizTalk exception handling

Conclusion

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.