BAM is a very good way to monitor a process in BizTalk but often there is not enough time in a BizTalk project to implement BAM because it can take some time to implement it. The advantage of the ESB Toolkit is that you get (some) BAM out of the Box.
Normally you first have to create a BAM definition in Excel and after that deploy it with the command line tool BM. Also you have to use the Tracking Profile Editor tool to map the activity definition to a process in BizTalk. With the ESB Toolkit are already
some activity definitions created. The logic behind the mapping is also done so you don’t have use the Tracking Profile Editor anymore. You only have to deploy the BAM definitions so now you can enable BAM tracking very easily.
The following activity definitions are available in the ESB Toolkit:
The tracked BAM data give you answers on common questions such as:
Tracking Itineraries in BAM can be enabled in the Itinerary Designer Surface in Visual Studio. The Itinerary Designer Surface is a visual designer that is used to create Microsoft BizTalk ESB Toolkit itineraries and to export these itineraries into run-time
Runtime are the following fields as an activity record added in the the BAM Primary Import database:
The ESB Exception Management Framework takes advantage of Business Activity Monitoring (BAM). This means that the ESB Exception Management Framework can track the exception data points with BAM, and then publish them to the BizTalk BAM Portal for monitoring.
When an error occurs, the following fields are as an activity record added in the the BAM Primary Import database:
The Microsoft BizTalk ESB Toolkit installs a Send Port named ALL.Exceptions that subscribes to all ESB fault messages and to all messages generated by the BizTalk Failed Message Routing mechanism.
Figure 2. ALL.Exceptions Send Port in Microsoft.Practices.ESB application.
ALL.Exceptions uses the ESBFaultProcessor Send Pipeline. The Fault Processor Pipeline BAM Tracker Component in the ESBFaultProcessor send pipeline adds the exception data to the BAM Primary Import database. Use the Enabled property to determine whether the
component will process the message and write it to the BAM database. When set to False, the component just sends the message to the next component in the pipeline.
Figure 3. ESBFaultProcessor Send Pipeline properties.
To use BAM in the ESB Toolkit solutions, you must install the following prerequisite applications and services. Follow this sequence to install the prerequisites and to configure your system.
You can verify the BAM results using a SQL query or the BAM Portal.
With pure ESB runtime you don't have reports on the BAM data. You can edit the BAM definition files to create views on the BAM activities but another possibility is to create the charts yourself.
I've created a custom BAM Dashboard in ASP.NET for the ESB Toolkit that shows information about:
Figure 10. Custom BAM Dashboard in ASP.NET.
List<ItineraryData> list =
// Get ConnectionString & SQL Query from web.config
connectionString = ConfigurationManager.ConnectionStrings[
sqlQuery = ConfigurationManager.AppSettings[
(SqlConnection connection =
(SqlCommand command =
(SqlDataReader reader = command.ExecuteReader())
ItineraryData iData =
iData.Name = reader[
iData.Date = DateTime.Parse(reader[
// Get data from BAM database
BamManager manager =
List<ItineraryData> executionTimes = manager.GetExecutionTimes();
// Get distinct Itinerary names
= executionTimes.Select(x => x.Name).Distinct();
// Create Series
Series s = ExecutionTimesChart.Series.Add(value);
s.ChartType = SeriesChartType.Line;
s.BorderWidth = 2;
s.MarkerStyle = MarkerStyle.Square;
s.YValueType = ChartValueType.Int64;
// Add Points to the Chart
Series s = ExecutionTimesChart.Series.FindByName(iData.Name);
index = s.Points.AddY(iData.ExecutionTime);
s.Points[index].LegendText = iData.Name;
s.Points[index].ToolTip = iData.Date.ToString();
BAM is a very good way to monitor a process in BizTalk and with the ESB Toolkit you can implement BAM without having to do a lot of effort. Out of the box you can monitor itineraries that are processed in BizTalk and monitor Exceptions that have occurred
in BizTalk. With pure ESB runtime you only don't have reports on the BAM data. To solve this you can edit the BAM definition files to create views on the BAM activities but another possibility is to create the charts yourself.
You can download the sample tool with the source code here:
Creating a custom BAM Dashboard for the ESB Toolkit
Read suggested related topics:
Another important place to find a huge amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk
Server Resources on the TechNet Wiki.
Good article Tomasso. I liked the dashboard part, could be very useful to many.
great article. thanks.