如何更改队列/服务的目标服务名称
我有一个 SQL Server 2005 Service Broker 队列“ProductChangeMessages”和一个 Service Broker 服务“ProductChangeNotifications”。这对是对 SqlDependency
的支持,我试图开始工作,但依赖项的 OnChanged 不会触发。当正在监视的表发生更改时,订阅(通过 select * from sys.dm_qn_subscriptions
的结果可见)将被删除。
SELECT * FROM sys.transmission_queue
显示的队列上有消息,其队列名称为 to_service_name
,并且在 transmission_status
中
找不到目标服务名称。确保正确指定服务名称和/或已提供路由信息。
因此,似乎生成消息的任何内容都试图使用队列名称而不是服务名称作为 to_service_name
。
我如何更改它以便它使用正确的服务名称?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你不能。首先,您需要从依赖项基础设施中使用正确的服务名称进行订阅。
要清理现有消息,您可以使用 big nuke 选项:alter database设置 new_broker 并立即回滚; 这将清除每个现有的对话/消息,但会保留所有服务/队列。细粒度选项是通过
enddialog来一一终止坏对话框。与清理
。You cannot. You need to subscribe with the proper service name from your dependency infrastructure to begin with.
To clean up the existing messages, you can use the big nuke option:
alter database <dbname> set new_broker with rollback immediate;
which will wipe out every single existing dialog/message, but will leave in place all services/queues. The fine grained option is to terminate the bad dialogs one by one viaend dialog <handle> with cleanup
.