Geeks With Blogs
Jan Schepens Software Developer

There are many cases in BizTalk environments when one want to re-inject a message into their system. I’m mainly referring to testing environments where it doesn’t really matter if a message is repeated.

However, it can also be preferred to copy the context of the message into the newly injected message, because your system might want to do some processing of that context while re-injecting. When you do this from code, it’s a snap!

First of all, we need to load up our message body and context:

image

Note that you need to specify the sql server name and database name of the BizTalk Tracking Database (commonly named BizTalkDTADb, but you can configure any database name). The System.GUID attribute should be replaced with the message id of the message you want to re-inject.

Now that we have an IBaseMessage object, we can access the context and copy it to the context of a new out IBaseMessage object.

 

image

 

This way we can keep a difference between promoted context properties and standard context properties. And that’s the only thing to it, msg_out is ready to be re-injected
to the BizTalk system

Posted on Wednesday, April 8, 2009 10:58 AM | Back to top


Comments on this post: Persist message context when re-injecting a message in BizTalk

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Jan Schepens | Powered by: GeeksWithBlogs.net