• venoym (9/3/2015)


    Very nice article!

    Fairly good description of how to get started. As always, there will be variability in your configuration and usages.

    Some things to remember:

    1. You can enable Service Broker without a Master Key by enabling Trustworthy if the routes are within the same SQL Instance

    2. Service Broker defaults to Disabled if the DB is detached or restored. This will cause your DB size to explode due to enqueuing all messages into the Transmission Queue. If you enable Service Broker you have to do it with a ROLLBACK IMMEDIATE and will lose all messages in the Transmission Queue.

    3. Trustworthy is also disabled (if using this option) in the same instances that Service Broker is... leading to the same issue restarting it.

    4. When Sending it's common place to use a timeout to automatically close conversations (it's an efficiency thing). This can lead to sending a message on a closed conversation if the message is set to be sent within a couple ms of the automatic closing of the conversation. the Service Broker Transmission Conversations dmv (I don't have SQL Server handy to get the actual DMV) has a timeout column that you can bounce against to prevent that.

    5. Any error in relation to Service Broker is severity 16 which places any transaction into an uncommitable state and forces a rollback of that transaction. Can be problematic at times.

    6. The Receive queue will close automatically on 5 exceptions during processing. You can't control this, any exception (even caught by a TRY...CATCH) adds to that number.

    Thanks for the additional info.