Many threads opened on this topic, none seem to have an answer for my problem so i am going to give it a try..
System : Windows Server 2012 SQL Server 2012 Enterprise edition
Problem : We are using SQLDependency to enable use of query notification in our application which means it creates its own service , queue and procedure.
Question 1: Looking in the stored procedure i see it does receive top 0. What does it mean to do top 0?
Now for the real problem.. Occasionally , the error log is filled with the following messages (to the point when i cant open it) : Query notification delivery could not send message on dialog 'X'.... because of the following error in service broker: 'The conversation handle X is not found. The messages appear with the same conversation_handle or 3 different the most.
when i query that conversation from sys.conversation_endpoints , i do see it and it is marked as is_system = 1 (STARTED_OUTBOUND).
I've added an alert on error 9245 to try and identify why it happens when it happens. In the message 'During the last time interval X query notification errors were suppressed' , the X is enormous and more than 10,000. i guess the number is related to retrials because we dont have such a number of notifications.
At first, i thought it might be related with the 'DialogTimer' message because i noticed that when i end the conversation of that specific message , the messages stop but recently it didnt work so the only think i could do to stop it is set NEW_BROKER.
it immediately happen when i do recycle to our application pool although i see in our logs it calls the SQLDependency.Stop , i dont see the objects (service,queue and procedure) dropped and the error messages start flooding the error log.
Please let me know if further details are required. Appreciate your help,