Saturday, September 15, 2012 5:32 PM
I am trying an option "BROKER_QUEUE_DISABLED" in EVENT NOTIFICATION it seems it is not properly generating a Broker Queue disabled event. SO can some one please validate the script which I created(see below)
-Thanks in Advance
CREATE QUEUE NotifyQueue
CREATE ROUTE NotifyRoute
WITH SERVICE_NAME = 'NotifyService',
ADDRESS = 'LOCAL';
EVENT NOTIFICATION [CHS_QueueDisabledNotif]
ON QUEUE [CHS_Change_Queue] WITH FAN_IN
TO SERVICE 'NotifyService', 'current database'
--Try Disabling Application Queue
ALTER QUEUE dbo.CHS_Change_Queue WITH STATUS = OFF
SELECT * FROM NotifyQueue
Monday, September 17, 2012 7:17 AMModerator
According to your description, it seems like that you have not got the event notification when you disabled the queue.
Please follow the blog below which includes sample code to create an event notification service to receive notification messages when a user queue being watched gets disabled:
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Edited by Iric WenModerator Monday, September 17, 2012 7:19 AM
Monday, September 17, 2012 11:16 PM
I found the reason, and below is my explaination
Service Broker creates an event notification only when a Service Broker queue is disabled because of a poison message. When you disable a queue manually, no event notification message is created. Because of this, an application has the possibility to subscribe to this event notification and react accordingly in this error situation. "
In my script i was trying disabling manually :)
Hope this helps.
- Marked As Answer by KVK Kumar Monday, September 17, 2012 11:16 PM