Search code examples
biztalkbiztalk-2013

%MessageID% different from BTS.MessageID


I am trying to identify the messages I am saving in a folder using MessageID property. However the MessageID values are different from the values I get when I use BTS.MessageID. Why?

In my orchestration I receive a message "myMsg" from a receive port (with receive pipeline: XML Receive). After that I check myMsg(BTS.MessageID) value with

System.Diagnostics.EventLog.WriteEntry("MessageID", System.String.Format("The Value = {0}", myMsg(BTS.MessageID)));

and I get for example this value: c9953bec-72a8-4274-9ea3-d7770c52d4ab

Then I send my message through a send port (with send pipeline: PassThruTransmit)

When the message is saved, the name is: {EE2AB9A1-FA3C-4737-BB02-6AC0C0EA5EBC}.xml

Why are they different? I thought they would be the same.


Solution

  • Each message is unique. Assume you have 2 send ports where that orchestration message would go to. Would you expect it to have the same message id as the one from the orchestration? I hope not, because you would have 2 instances of a message with the same message id. (Actually 3 because you should also count your orchestration message is).

    I guess what you're looking for is the InterchangeID, this one stays the same.