BizTalk: Accumulating messages in MessageBox, Lifespan of the messages

 
I hit this problem when was creating the orchestration to periodically poll the external service. The orchestration was with loop inside.
The problem was I created the message inside this loop. The instance of this message was not disposed after each cycle. The BizTalk does not have such functionality as explicit deleting the messages inside orchestration.
The orchestration was created for running long time without restart. That means this orchestration was collecting enormous amount those indisposed messages. And all those messages were inside the MessageBox, of course. It was wrong!
 
After long and very interesting investigation the issue was resolved.
 
The source of the problem was in the transactional scope where I created the indisposable message. This scope was inside the loop. The message was recreated on each cycle of the loop.
A lifespan of the message recreated inside the transactional scope included in the loop and the message recreated outside the  transactional scope in the loop is different. The first one is disposed only after closing the orchestration instance. The second one is disposed after last using. (I think so but could not find a hint in the BizTalk information sea.)
 
After discovering this fact, the fix was simple. I moved the transaction scope outside of the loop.
Print | posted on Wednesday, November 14, 2007 1:15 PM

Feedback

# re: BizTalk: Accumulating messages in MessageBox, Lifespan of the messages

left by Leonid Ganline at 5/8/2009 3:45 PM Gravatar
http://blogs.msdn.com/richardbpi/archive/2006/12/06/transactions-and-compensation-using-biztalk-server.aspx - this article by Richard Seroter gives some clues why it happens.

# re: BizTalk: Accumulating messages in MessageBox, Lifespan of the messages

left by Martin Peters at 1/6/2010 5:02 AM Gravatar
I think I'm wrestling with the same problem and wonder if this applies to atomic scopes only or also to long-running orchestrations as well? Perhaps you can post a picture of the orchestration before and after the change?
Post A Comment
Title:
Name:
Email:
Comment:
Verification: