Read this before using bts_CleanupMsgBox stored procedure.

Posted at: 6/4/2008 at 10:37 AM by saravana

Subject: Losing subscriptions after running the sproc, resulting in complete redeploy of BizTalk application(s).

bts_CleanupMsgBox is not something new and it's been there from BizTalk 2004 SP1. Basically this script is used to clear the MessageBox database (intended only for development and especially useful while during performance testing). This script is not installed by default, the stored procedure will be empty and does nothing. That's how it should be on a production box, so no one accidentally runs it. You can install the stored procedure (please don't do it on production server) by running the SQL script presented inside installation folder "C:\Program Files\Microsoft BizTalk Server 2006\Schema\msgbox_cleanup_logic.sql"

Read this great post from Lee, explaining how to use it properly.

Recently, I been using the script very frequently on our performance environment after each test run to bring the environment to a clean state. Couple of days back when I ran the script, I lost all the subscriptions. We had around 13 BizTalk applications in our environment. Executing a query from Admin Console for subscription only showed subscriptions for Caching Service. Stopping and Starting the BizTalk Applications (Enlisting all Send Ports/Orchestrations) only brought back Send Port Subscriptions and Orchestrations subscriptions were not created whatsoever. The only way I managed to bring it back is by stopping/deleting existing BizTalk applications and re-importing them back in one server, then I had to apply the correct binding file and set all the modified parameters before continuing the test. We lost few hours of our valuable performance slot.

Reason:

The reason is so simple, only thing I did wrong this time was generated "EXECUTE" script from SQL Management console, which generated the script as shown below

ss

the parameter @fLeaveActSubs is by default set to "1" in the stored procedure, so if you run it normally using the command "exec bts_CleanupMsgBox", everything is well and good, it will leave the subscriptions.

But by generating the "EXECUTE" script and running it, this value is set to "0" (default), which in turn results in clearing the subscriptions.

Million Dollar Question!!

Why do we have this option in the first place in this stored procedure? Do we really need to clear the  subscriptions at any stage of testing. I can understand clearing all instance subscriptions, but why do we need to clear the activations subscriptions, and resulting in a environment where we couldn't bring it back, unless we do a redeploy.

Probably I could have tried running the piece of SQL inside the ELSE part of the IF condition @fLeaveActSubs <> 0, but I didn't want to leave the environment in a completely unstable state. So redeployed all of our applications (time consuming but safe bet).

If someone can explain the reason behind it, I'll happily update this post.

Thanks Gunjan Jain (Microsoft, India) for pointing this out.

Nandri,

Saravana

Tags: |  Categories: BizTalk General
Actions: Email this article Email | Kick it! | DZone it! | Save to del.icio.us | Technorati Links
Post Information: Permanent LinkPermalink | CommentsComments(11) | Comments RSS

Comments

Wednesday, June 04, 2008 3:58 PM
Lucas Vogel
I could think of a couple of (very limited) scenarios where I'd want my activation subscriptions removed:

- Load testing/troubleshooting data coming into an application

- Load testing/troubleshooting the MessageBox. For example, perhaps I've just migrated to a multi-MessageBox environment and I want to do a quick test to see how the load is distributed by my application without running anything through.

I would think that this kind of activity is limited to BizTalk deployments where you have only a couple of orchestrations deployed, considering the impact you mentioned in your post. The functionality is definitely limited to that 1% that actually *need* it, but IMHO it's probably the most logical place to put that flag, considering the number of 'support' procedures there are for MessageBox maintenance...
Thursday, April 16, 2009 8:53 AM
trackback
Trackback from NSilverBullet

100% CPU usage in BizTalk development environment
Friday, July 23, 2010 7:54 AM
Retro Jordans
So happy to enjoy such a insightful article that does not depend on base posturing to get the topic fulfilled. Keep it up!
Saturday, July 31, 2010 9:27 AM
new balance
Do you would like to have a several expertise? To our web site! There are many shock waiting for you personally!http://www.yaahshoes.com/
Thursday, August 05, 2010 1:45 AM
Seattle Limos
I have been checking out your posts for the last couple of hours, and everything has been very informative and well written.  I just wanted to tell you that for some reason this one doesn't seem to work in Internet Explorer.  On a side note, I was wondering if you wanted to swap blogroll links?  I hope to hear from you soon!
Saturday, August 07, 2010 3:52 PM
Sex Chat
Hi, How is it going? I have to say that i enjoy the special source of content of your blog a great deal, can't help wondering where you get all of this from. Best regards Henrik Hanson
Saturday, August 07, 2010 4:20 PM
Nude Cam
adding this info to my blog if thats ok dude.
Sunday, August 15, 2010 10:33 PM
payday loan
I always wanted to write in my site something like that but I guess you'r faster Smile
Wednesday, August 18, 2010 12:50 PM
vimal
SPORTS BETTING World's No.1 destination for online betting, football betting, baseball betting,spread betting & horse racing betting on the internet. Online Betting made simple & secure at SPORTSBETTINGCHUMP.COM
Wednesday, August 25, 2010 4:46 PM
Affiliate Marketing Help
Good to be visiting your blog again, it has been months for me. Well this post that i've been waited for so long. I require this post to total my assignment in the college, and it has same topic with your post. Thanks, excellent write about.
Monday, August 30, 2010 1:07 AM
sports bets
Cornell University PhD graduate John Morrison at SportsBettingChamp.com has discovered an unbeatable sports betting system that's been producing 97% win rate over the last 50 years of sports! For the first time ever, John has finally unleashed his unbreakable sports betting system to the market. YOU can now gain access to the same exact, smoke-and-mirrors-free, no hocus pocus, crystal-clear betting formula that he uses to erect a mountain of mind-boggling fortune at the click of a button each day! Take a look at the sports betting champ?s incredible win-loss betting record since 2003: NBA Basketball: 2003-04 season: 68 wins ? 2 Losses 2004-05 season: 71 wins ? 3 Losses 2005-06 season: 66 wins ? 2 Losses 2007-08 season: 80 wins ? 1 Loss 2008-09 season: 78 wins ? 0 Losses MLB Baseball: 2004 season: 33 wins ? 0 Losses 2005 season: 45 wins ? 0 Losses 2006 season: 38 wins ? 1 Loss 2007 season: 35 wins ? 0 Losses 2008 season: 43 wins ? 0 Losses 2009 season: 49 wins ? 0 Losses Along with this red-hot betting system, John will also provide you with a lifetime of free picks, an unheard-of deposit bonus offer, an unprecedented "No Ifs, Ands, or Buts, Sale Not Final Until You're Fully, Wholly, and Absolutely Convinced Refund Guarantee" - plus a dose of other splendid incentives! Head on over to <A href="bit.ly/.../A> today to take a look at this limited time offer before the door to this opportunity forever closes down!

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading