How can I check if my queue (Service Broker) is enabled or not?

rarely, for reasons not yet defined, my queue is disabled, when this happens I re-enable this request:

  ALTER QUEUE [MyQueue] WITH STATUS = ON;

      

but I want to know when the queue is disabled, like an event (T-SQL), or check every "x" time if the queue is enabled.

+3


source to share


1 answer


Take a look sys.service_queues

:

select is_receive_enabled
from sys.service_queues
where name = N'MyQueue';

      



Your queue is being disabled by the poison message handling mechanism . When this happens, an event occurs that can be recorded using event notification, see Disable Application Broker Service Queue Event .

+11


source







All Articles