I want to create a send port that writes all messages going in and out of
biztalk to file - to a file is not possible with an out-of-box features.
If all the messages processed in your BizTalk does have message type i.e if you have used XML-Receive in the Receive Location, then simple solution like BTS.MessageType
Exists as opposed to multiple filter for every messagetype as BTS.MessageType == YourSpecificMessageType will work (
as suggested in another forum for exactly same question). Also you need to set the send ports Copy Mode to Append
from its default setting of Create New. Append will append the received files content to a file as you asked rather than creating new file for every received file
But when you mean by messages processed in BizTalk, then messages received by Pass-through pipeline in Receive location is also message and they will have not MessageType
property, so the above filter in the send port will not be subscribed.
Tracking in the send port may not help your requirement. You can consider having a custom archive pipeline component to archive the processed messages to a file, but still
since you want to write the content to a file not to a disk, you may have file access issues since all the content will be written to a same file.
One option is have a custom pipeline component or Orchestration and use
BizTalk CAT Instrumentation Framework adjust filter options, log the received messages to a file. If you use a custom pipeline component then you have to configure this pipeline in every port. If you use Orchestration, then you need to subscribe
to a Orchestration message of type System.XML.XMLDocument and another filter and when the message in send out of this tracing Orchestration, change a context property to the other filter
so that the same message is not subscribed back by this Orchestration.
Regards,
M.R.Ashwin Prabhu