Showing posts with label persist. Show all posts
Showing posts with label persist. Show all posts

Thursday, March 8, 2012

Can SQL Service Broker persist requests?

I have a scenario where we want something like a message bus. We can have multiple clients sending in events and would like a way to

i) persist those events

ii) Send out the notifications to the subcribers (this would be some C# services)

What is the best way to do this? I know that we can build something from scratch using WCF Publish-Subscribe. But i was interested in knowing if I can leverage SQL Service Broker to do the work.

When you create the Queue, you can set the RETENTION of the queue to ON so that messages are not removed from the queue once they have been processed.|||Thanks Tim! I'll give that a try.|||Great. Let me know if it solves your problem.
Tim|||

Tim,

The Retiontion=On does solve one part of the problem. However, I am trying to achieve a Publish-Subscribe mechanism. So far all the examples I have come across for Service Broker seem to be more of a 'Pull' mechanism rather than a 'Push'. Is it possible to implement a Push type messaging with Service Broker? How do I get started?

Thanks,

Meera

|||Have a look at https://blogs.msdn.com/remusrusanu/archive/2005/12/12/502942.aspx|||

Thanks Remus! I took a quick look at it. I need to tweak it a bit since i want my C# applications((instead of stored procs) to process the messages.

|||

Remus,

I've been looking at sample code, but cannot figure out how I can pass on the notifications to my C# client applications. Referrign to your publish-subscribe code, what I have is a case where once an article is published, my CLR code should get executed, instead of the stored procedure. Also, each of the subscribers will be CLR apps.