Service Broker Queue Custom Reports

帅比萌擦擦* 提交于 2019-12-12 03:14:50

问题


we have started research on Service Broker and planning to implement in application. But we are not getting how to display Statistics reports(in UI) containing: 1. No of messages in the queue. 2. No of Messages so for Executed/Completed. 3. No of messages IN Process, Waiting, Failed,etc 4. No of Conversations in Specific period of time,etc etc etc....

Is there any possible way to fetch these information fully/partially

Any help regarding this is highly appreciated.

Thanks in Advance.


回答1:


Use Catalog views (msdn). For example:

Select * From sys.service_queues
Select * From sys.transmission_queue
Select * From sys.conversation_groups
Select * From sys.conversation_endpoints

Use DMV (msdn). For example:

SELECT spid, DB_NAME(database_id) database_name, OBJECT_NAME(queue_id) queue_name,
    procedure_name, execute_as
FROM sys.dm_broker_activated_tasks
WHERE database_id = DB_ID();

SELECT DB_NAME(database_id) database_name, OBJECT_NAME(queue_id) queue_name,
    state, last_empty_rowset_time, last_activated_time, tasks_waiting
FROM sys.dm_broker_queue_monitors
WHERE database_id = DB_ID();

Use SQL Server Log. Can do also like this:

EXEC sys.xp_readerrorlog 0, 1

Use reports in Management Studio. Go to "Service Broker" node, right click and then "Reports-> Standart Reports-> Service Broker Statistics"



来源:https://stackoverflow.com/questions/9798155/service-broker-queue-custom-reports

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!