Service Broker Queues, where are they?

  • Hello,

    Sorry if this is a ridiculous question, but I am trying to find out where the service broker queues are on my server. I have done a search but all the articles I see say they reside in the same filegroup as the database unless specifed, which may or may not be the case. Does anyone know of a view or query I can use that will tell me what folder the Service Broker queues are in, please?

    Thanks for reading.

    Regards,

    D.

  • Queues are per-database. msdb uses them for mail handling and so is a good first place to look.

    Select * From msdb.sys.service_queues ssq

  • Thank you for answering, most appreciated. I ran the line that you gave, but not sure how to read the result, in the instance I have 4-5 DB with server broker enabled on them. How do I get the info on service broker per database? I still dont know where the queues are, can you help?

    Thank you in advance for any help.

    Regards,

    Paul.

  • You can iterate your database list with a cursor or procedure or however else you want and use that query to list out the queues. Any row that is returned from that query is a queue in that database.

    You can also inspect messages in each queue; with a select * from the name of the queue in the above query. The name of the queue doubles as a kind of table name you can read messages from. A select is safe; there are other commands to pop messages off the queues permanently.

    I'm not sure what else you're asking but there are quite a few videos around on how service broker works (and one book for 2008) that can explain it in more detail.

  • ah sorry Cody, I basically completly misunderstood the line of code! Thank you, this is what I am after.

    Regards,

    D.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply