5

After using SQLDepdendency as a queue implementation in one of my projects (now live) and after discovering that it is ineherinitley broken (see http://rusanu.com/2008/01/04/sqldependencyonchange-callback-timing/).

I am desperately looking for alternatives. I am focusing on using SQLNotificationRequest as a replacement, which is what SQLDependency leverages to create a convenient implementation by dynamically creating a Queue and ServiceBroker service at runtime.

I have scoured the internet but i cant seem to find any good examples on SQLNotificationRequest, i have looked here http://msdn.microsoft.com/en-us/library/3ht3391b(v=vs.80).aspx, but the code is buggy and doesnt work as expected.

I have also looked at code-project, http://www.codeproject.com/Articles/18130/Advanced-SQL-SQLNotificationRequest-Functiona but the author maintains that the code is a proof of concept only and also doesnt behave as expected.

Does anyone out there have a good resource they have come across regarding SQLNotificationRequest? A book maybe with a good example or maybe suggestions how to fix the code in link1?

I have run the code but it keeps continuing to check for notifications rather than only fire when changes actually occur the database (changes counter keeps running continously)

enter image description here

gorillapower
  • 450
  • 6
  • 15
  • What is it that you actually need to support here? Would it be possible, for example, for code to *announce* changes that have been made? There are a lot of very simple to use pub/sub APIs that can be used for message delivery, etc – Marc Gravell Apr 03 '14 at 09:06
  • Im basically using a sql table that acts as queue and am using the SQLDependency to watch for changes to the table. From their i get the table contents and process the queue. Thing is ive already built my system around this implementation and would prefer to try and fix the problem...but if needed i will have to create a different queueing system. – gorillapower Apr 03 '14 at 10:42
  • I'm not necessarily saying "change the queue" - I'm only talking about the notification process. Frankly, I've never been satisfied that SQL notifications work for real-world scenarios. – Marc Gravell Apr 03 '14 at 10:51
  • 1
    You can try SqlDependencyEx - i tried it and pretty good. More info can be found here. https://github.com/dyatchenko/ServiceBrokerListener – kepung Apr 19 '17 at 22:37

0 Answers0