Re: issue using BTS.MessageID after message assignment

Home Page Forums BizTalk 2004 – BizTalk 2010 issue using BTS.MessageID after message assignment Re: issue using BTS.MessageID after message assignment

#15709

So you want the message ID of the newly constructed message? 

 

One reason you see what you are seeing is the message doesn’t get constructed until a persistence point is reached.  At that point, the new message will get persisted to the database and get assigned all the context properties.  I’m guessing the reason you see it when you run the debugger, is that forces a persistence point.  Likewise when you send out the message; another persistence point.

 

Try this as a test…. Right after the contract put in an Atomic Scope.  This will force a persistence point.  See if that solves the problem.

 

If that fixes it, you can then look at a better way to force a persistence to get your message id.

 

Hope this helps.