I have a SQL Server 2005 Service Broker queue "ProductChangeMessages" and a Service Broker service "ProductChangeNotifications". The pair are the backing to an SqlDependency
I'm trying to get working but the OnChanged of the dependency doesn't fire. When the table being watched changes the subscription (visible through the results of select * from sys.dm_qn_subscriptions
) is removed.
There are messages on the queue shown by SELECT * FROM sys.transmission_queue
which have the queue name as their to_service_name
and in the transmission_status
they have
The target service name could not be found. Ensure that the service name is specified correctly and/or the routing information has been supplied.
So it appears that whatever is generating the message is trying to use the queue name rather than the service name as the to_service_name
.
How can I change this so that it is using the right service name?