I recently started to integrate broker service in to my NET server app to invalidate/refresh cached data as using through SqlDependency.
However just found out "poison message" such as rollback and database error multiple occurance will cause the broker auto disabled.
I tried to create a queue:
CREATE QUEUE MyBrokerQ
WITH STATUS = ON,
POISON_MESSAGE_HANDLING (STATUS = OFF)
But having problem as SqlDependency.Start(ConxStr, "MyBrokerQ") doesn't seems to work, i revert this back to just SqlDependency.Start(ConxStr)
I tried to incorporate code to detect when the broker is down, attempt to renable it through SQL:
ALTER DATABASE MyDb SET ENABLE_BROKER
However this will cause timed-out, and I believe connected sql session will disrupt it.
I'm getting the impression SqlDependency/broker service is not the right choice for me.
If u know any proper way to do it through .NET 4.5 (I'm using EF6 too), let me know.
As far as I researched, I only found code samples, and none of these mentioned about the auto-disabled, until I encountered and research for resolution.