They are pretty easy and repeat the “Generic Error handling” pattern. They use the Direct port subscription.
- Create the generic_audit schema. It can, for example, include elements: “Operation datetime”, “Operation type”(Send/Receive/…), “Original message parameter (like File Name)”, “Success/Fail status”, “My_Specific_parameter” etc.
- Create simple maps to produce the generic_audit schema from all other messages. It is not necessarily all audit parameters be mapped from the source message. Some of them might be produced inside map or expressions, for example, the “Operation datetime” parameter.
- Create the Audit Send Direct port with these maps in the entry.Make filters for all audited message types, i.e. subscribe to all these message types.
- If we want to save the audited messages in the database: Create the Audit database. The simplest database might be with one table and one stored procedure to fill-in this table.
“…On at least a couple of occasions I have heard MS employees endorse BAM for auditing. We brought a Microsoft consultant to review our architecture and design with respect to auditing. He suggested we use BAM for this purpose. Note he did not endorse message body tracking inside of BAM. The other place that I have seen it endorsed is at TechEd at one of Darren Jefford’s sessions.
Without a doubt building up the required BAM infrastructure is not a trivial task(especially in an enterprise scenario). Keeping things simple is often the best solution, so I do think that you have brought up some valid points. …”
One more discussion about using HAT to tracking messages is here (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1991237&SiteID=1).