locked
Subscribe to all messages in biztalk for logging RRS feed

  • Question

  • I want to create a send port that writes all messages going in and out of biztalk to file. My orgaiztion is using splunk. Splunk will import data from the file directory to make sense of the various messages.

    Is it possible to create filter in a send port that subscribes to "everything"? I could solve this by applying filter for each message type in my system. However, there is a lot of messages going back and forth and I'm wondering if there a simpler solution?
    I'm using biztalk 2013.

    Wednesday, February 18, 2015 8:13 AM

Answers

  • “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 port’s “Copy Mode” to “Append” from its default setting of “Create New”. Append will append the received file’s 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


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.


    Wednesday, February 18, 2015 9:56 AM

All replies

  • Hi

    Enable tracking on all receive and Send ports.

    Then all the message going back and forth  from BizTalk will be tracked in BizTalk Tracking data base (DTA).

    You can retrieve data from DTA DB.

    https://connectedthoughts.wordpress.com/2008/04/02/3-ways-of-programatically-extracting-a-message-body-from-the-biztalk-tracking-database/

    There should be dedicated tracking host be running to move tracking data to DTA database for better performance.

    Thanks &Regard

    -Ammu.



    • Edited by Ammu_Biz Wednesday, February 18, 2015 9:25 AM
    Wednesday, February 18, 2015 8:43 AM
  • “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 port’s “Copy Mode” to “Append” from its default setting of “Create New”. Append will append the received file’s 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


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.


    Wednesday, February 18, 2015 9:56 AM
  • Hi Ashwin,

    Why enabling tracking will not work here.

    Thanks

    Ammu.

    Wednesday, February 18, 2015 10:28 AM
  • Hi Ammu,

    Give it a try and you will get to know.

    Enabling tracking at the port will track the message and its context to tracking db not to a file as questioner asked. And you need to have a custom solution to extract the tracked data in to file as you mentioned. Enabling tracking in all the ports will also have maintenance issues as this could lead into performance issue later. Certainly it’s a simple solution but has more maintenance issues in long run when you need to track message from the ports.


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    Wednesday, February 18, 2015 10:41 AM
  • Also bear in mind that any Pipeline and/or Map processing done on a Receive Port will not be reflected on the Message hitting the Message Box. Therefore subscribing to "all messages" will not give you the original message received (which is often the requirement). 

    So you should consider Tracking or, even though not my cup of tea, an Archiving Pipeline Component.

    Morten la Cour

    Wednesday, February 18, 2015 10:53 AM
  • Thanks! This works perfectly:)
    Friday, February 20, 2015 2:42 PM