1. Problem
You want to be able to view
the contents of messages that have arrived in a given BizTalk solution
to monitor messages and actions that have been processed through ports
and orchestrations.
2. Solution
The ability to monitor orchestration activity and access message contents and flow is known as tracking messages.
BizTalk allows tracking to be set at a number of different levels. This
solution describes how to configure tracking so that messages can be
saved in their entirety and viewed in any text editor. You can configure
tracking using the BizTalk Administration Console.
2.1. Configure Tracking
The following steps
outline the procedure to configure tracking on receive ports, send
ports, and on any orchestrations where messages need to be tracked.
Open the BizTalk Administration Console.
Expand
the tree in the left pane until the BizTalk application that contains
the solution on which you want to configure tracking is visible, and
then click the Receive Ports folder.
In the right pane, right-click the receive port that is to be configured for tracking, and select Tracking, which is shown in Figure 1.
In
the Tracking Options dialog box, set the desired options for tracking.
The settings are generic across one-way and two-way ports.
Request Message Before Port Processing:
Request messages exist in one-way and two-way ports. Checking this
value will track the message prior to being processed by the port
(processing includes any pipelines or maps that may be on the port).
NOTE
A message is a request if the message is initiated by the port/orchestration. A message is a response if the port/orchestration is receiving it from an external source.
Request Message After Port Processing:
Checking this value will track the message after it is processed by the
port (processing includes any pipelines or maps that may be on the
port).
Response Message Before Port Processing:
Response messages exist on two-way ports only. Checking this value will
track the message prior to being processed by the port (processing
includes any pipelines or maps that may be on the port).
Response Message After Port Processing:
Checking this value will track the message after being processed by the
port (processing includes any pipelines or maps that may be on the
port).
If
desired, configure tracking for send ports. Right-click the send port,
select Tracking, and choose options in the Tracking Options dialog box.
Configure tracking on the appropriate orchestrations. In the left pane of the BizTalk Administration Console, click the Orchestrations
folder. In the right pane, right-click the orchestration, and select
Tracking. In the Orchestration Tracking Options dialog box, you can
configure tracking on events and on messages within the orchestration,
as shown in Figure 2.
2.2. Access Tracked Messages
After you have configured tracking through the BizTalk Administration Console, access the tracked messages as follows:
Drop a message on the appropriate receive location to instantiate the orchestration.
Open the Group Hub page, and run a query that will return message instances.
Right click the message, and select Save to File to select a folder to save to, as shown in Figure 3.
Depending on the complexity of
the orchestration, the number of send and receive ports, and the level
of tracking configured, there may be a few or a large number of messages
written out to the directory specified. A combination of system
messages and XML messages will have been tracked.
3. How It Works
There is a direct
relation between the level of tracking configured for a given solution
and the size of the underlying BizTalk databases. For solutions with
high levels of tracking and a high volume of message transactions,
databases can grow quickly. An intelligent approach to traditional SQL
database management is required, especially as it pertains to table
truncation and data backups.