I have just finished my presentation on asynchronous
process/parallel processing using Service Broker at the Microsoft Technology Conference in Ireland. I was a bit tentative after deciding last night,
after a few guinesses and whisky (thanks Barry), to add a new feature to my presentation,
failure.
Yep I thought it would be great if I did a demo of how service broker handled
failure and performed reliably. How can I simulate failure I thought, well the
best I could come up with at short notice was to shutdown Sql Server with no
wait whilst service broker was processing.
Anyone that has done presentations will realise that effectively killing
SQL Server mid demo is probably not the wisest idea., any way the presentation
was going well and so I went for it.
In my demo Service Broker is configure with activation to run an SP process
the messages and upload the file.
So I kicked of my process that results in ~180
messages(files) sitting in the queue to be uploaded. I then showed that Service Broker was processing
some messages and then shutdown SQL.
Once shutdown, my app dies because it can't access the DB.
I then restart SQL and pray.
Eventually the databases recover and service brokder starts processing the
messages again without any intervention.
Wow it worked. When I tried it last night I was quite shocked that it
worked.
A video of this will is available here http://sqlblogcasts.com/files/folders/servicebrokerdemos/entry1884.aspx