Service Broker - Reliable processing

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



-
Published 07 June 2007 13:19 by simonsabin

Comments

07 June 2007 15:49 by dong

# re: Service Broker - Reliable processing

Hi, Simon,

Do you have a solution/work around to tackle the laptop behind NATs problem with Service Broker? Suppose the Target is a server with fixed IP, laptops are Initiator, via 1+ NATs to Internet. Do you think this gonna work?

Best regards,

dong

11 June 2007 13:41 by simonsabin

# re: Service Broker - Reliable processing

You should be able to achieve this with port forwarding. In essence the target needs to be able to find a route back to the initiator. That does mean that you need to be able to configure the firewalls to setup port forwarding.