title: SQL Service Broker as a generic Enterprise Message Bus for .net
body: <p>I'm in need of an Enterprise Service Bus/Message Queueing solution for publisher/subscriber functionality.  I know MANY exist... MSMQ, MS Series, RabbitMQ, NServiceBus, etc etc etc...</p>
  
  <p>My one requirement is that in a shared hosting solution, the only dependency that I can guarantee will exist is SQL 2005 and later... this leads me directly to SQL Service Broker.</p>
  
  <p>If it sounds like I'm trying to shoehorn ESB functionality into SSB... I suppose I am...</p>
  
  <p>My question is: does anyone know of a .NET API or framework that sits on top of SQL Service Broker and already provides much of the plumbing?</p>
  
  <p>If I were to use pure ADO.net, I could add items to the queues by calling a stored procedure, but then:</p>
  
  <ol>
  <li>Do to the nature of conversations, would I make one conversation per message?  </li>
  <li>If so, do I lose <strong>sequential</strong> message processing?</li>
  <li>How do I receive messages (I know the receive syntax in t-SQL), do I call a stored procedure repeatedly in a message loop to try to
  get a message off the queue?</li>
  <li>Or would I WAITFORever?  Keeping the connection open and executing the stored procedure forever?</li>
  <li>SQL Service Broker doesn't support monologue conversations, but I read they can be implemented...</li>
  </ol>
  
  <p>It's these kind of questions that make me wish there existed a .net solution that already managed all of this.</p>