码迷,mamicode.com
首页 > 其他好文 > 详细

service broker发送的消息不可达

时间:2015-10-18 01:15:28      阅读:226      评论:0      收藏:0      [点我收藏+]

标签:

 1 Use HelloWorldDB
 2 go
 3 
 4 SET NOCOUNT ON
 5 DECLARE @conversationHandle uniqueidentifier
 6 
 7 Begin Transaction
 8 -- 开始 Hello World 服务的对话
 9 
10 BEGIN DIALOG  @conversationHandle
11 FROM SERVICE    [HelloWorldResponseService]
12 TO SERVICE      HelloWorldRequestService
13 ON CONTRACT     [HelloWorldContract]
14 WITH ENCRYPTION = OFF, LIFETIME = 600;
15 
16 -- 发送消息
17 SEND ON CONVERSATION @conversationHandle 
18 MESSAGE TYPE [HelloWorldRequest] (NHello World)
19 
20 commit

执行上面的发送消息代码,出现如下错误

select cast(message_body as nvarchar(MAX)) from [HelloWorldInitiatorQueue];

<?xml version="1.0"?><Error xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8489</Code><Description>The dialog has exceeded the specified LIFETIME.</Description></Error>

是因为权限不够导致的!

解决方法很简单:

将SQL Server实例服务器登陆身份改为local system登陆,然后重启实例服务即可;

引用自下面博客:

http://www.cnblogs.com/kerrycode/archive/2013/09/25/3339558.html

 

service broker发送的消息不可达

标签:

原文地址:http://www.cnblogs.com/consuvi/p/4885747.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!