Tracking messages using same ID from receive pipeline to send pipeline but unique for each requests


  • Hi

         I need to track messages based on a unique ID.

    In BizTalk starting from receive pipeline , maps, orchestration , send pipeline- the ID should be same but unique for each requests.

    I will receive only one requests in the XML.

    So that for each requests the ID will be unique plus from receive pipeline to send pipeline its same for that requests.

    Is there anythng like MessageID,interchange ID ?

    which ID to use?

    In case if the application is suspended, for retry the same ID should be used.

    Many Thanks


    • Edited by Sriram27 Thursday, September 12, 2013 1:18 PM
    Thursday, September 12, 2013 1:02 PM


All replies

  • Both MessageID and InterchangeID may be suitable depending on the scenario.

    However, they are not natively carried though the whole process so you will have to do come custom handling.

    Here's my recommendation.

    1. Create a Message Context Property (using a Property Schema) that you own.

    2. At the first opportunity, a custom Pipeline Component will work, but an Orchestration is easier, set you custom property with the original message's MessageID and/or set a variable.

    3. Manually set your property on any subsequent messages that are created, such as by a Map.  Otherwise, each Message will have it's own unique MessageID.

    The syntax would be:

    MyMappedMessage(MyProps.MyMessageID) = MyOriginalMessage(BTS.MessageID);

    Thursday, September 12, 2013 2:03 PM
  • Thanks! But how do I use this promoted property in my pipeline component(decode stage) ?

    Is there any way to promote BTS.Interchange or MessageID in my pipeline?

    If I can promote the BTS.messageID in pipeline, Can I use the same messageID in orchestration?

    eg in pipeline BTS.MessageID=AJKL123 and also in orchestration BTS.MessageID=AKJL123?



    • Edited by Sriram27 Thursday, September 12, 2013 2:11 PM
    Thursday, September 12, 2013 2:08 PM
  • Couple things here.

    First, do you need the property to actually be Promoted, for Routing, or do you just need the value?

    Second, BTS.MessageID is generated by the engine so it will appear on every message, regardless of the source so it's always available in Orchestrations.  I wouldn't change it though.

    Finally, you can use this syntax in any Pipeline Component:

    string MyMessageID;
    Object propObject = context.Read("MyMessageID", "http://MyCustomPropertyNamespace"); 
    if (propObject != null) 
         MyMessageID = (string)propObject;
         //appropriate actions for a missing property

    Thursday, September 12, 2013 2:22 PM
  • I need to use the messageid or interchange id for getting the value(whatever generated by engine)..for eg whatever ID I receive in my receive pipeline decode stage(if its generated by biztalk engine),the same ID should be received in the orchestration. this is to find a match for tracking my message.


    • Edited by Sriram27 Thursday, September 12, 2013 2:29 PM
    Thursday, September 12, 2013 2:27 PM
  • So, you want to be able to search on a value and have the message at each stage of you process returned in the results.

    No problem, follow the steps above except yes you will have to Promote your custom Property at each step.

    In the Receive Pipeline in a custom component, you would use:

    inMsg.context.Promote("MyMessageID", "http://MyCustomPropertyNamespace", BizTalkMessageID); 

    That assumes you've already retrieved BizTalkMessageID using the above.

    In the Orchestration, you will have to Promote by Initializing a Correlation Set on the Send Port.  See example here:

    Finally, after you've deployed the project, open the Schema properties in BizTalk Administrator and select your property or all properties on the Tracking tab.

    • Proposed as answer by Padshiv Wednesday, September 18, 2013 7:31 AM
    • Unproposed as answer by Padshiv Wednesday, September 18, 2013 7:32 AM
    • Proposed as answer by Padshiv Wednesday, September 18, 2013 7:32 AM
    Thursday, September 12, 2013 4:14 PM
  • Thanks! May I know What is BizTalk messageID?

    Is it defined at the pipeline as MyMessageID.MessageID?


    Friday, September 13, 2013 4:15 AM
  • Sorry, I don't follow.

    BTS.MessageID is a unique identifier added to every message by the BizTalk.

    Friday, September 13, 2013 2:13 PM