C# 客户端未读取远程MSMQ队列,但可以发送到远程队列
我用C语言开发了Windows服务# 我的Windows Server 2012有两个专用队列:queueRequests和queueResponses 我的队列不是事务性的 我有一个客户端,它使用MyDomain\UserDeploy凭据执行控制台应用程序 服务器中的Windows服务使用凭据MyDomain\UserAgent执行 MyDomain\UserAgent和MyDomain\UserDeploy用户完全控制队列:queueRequests和queueResponses 服务器和客户端位于同一MyDomain中 控制台应用程序客户端,用于从服务器中的专用队列发送消息和读取消息 服务器中的Windows服务,用于从/toprivate队列发送消息和读取消息 执行步骤:C# 客户端未读取远程MSMQ队列,但可以发送到远程队列,c#,msmq,C#,Msmq,我用C语言开发了Windows服务# 我的Windows Server 2012有两个专用队列:queueRequests和queueResponses 我的队列不是事务性的 我有一个客户端,它使用MyDomain\UserDeploy凭据执行控制台应用程序 服务器中的Windows服务使用凭据MyDomain\UserAgent执行 MyDomain\UserAgent和MyDomain\UserDeploy用户完全控制队列:queueRequests和queueResponses 服务器和客
const string ForSend = @"FormatName:DIRECT=OS:{0}\private$\DeploymentCommands";
const string ForRead = @"FormatName:DIRECT=OS:{0}\private$\DeploymentResponses";
private DeploymentResponse WaitForResponse()
{
try
{
Message rsp = colaStatus.ReceiveByCorrelationId(correlationId, new TimeSpan(0, timeOut, 0));
DeploymentResponse ret = rsp.Body as DeploymentResponse;
Console.WriteLine("Respuesta WaitForResponse:" + ret.DeploymentId + " - " + ret.Status);
Trace.WriteLine("Respuesta WaitForResponse:" + ret.DeploymentId + " - " + ret.Status);
return ret;
}
catch (MessageQueueException ex)
{
Console.WriteLine("Error WaitForResponse in remote server " + remoteServer + ". " + ex.Message);
Trace.WriteLine("Error WaitForResponse in remote server " + remoteServer + ". " + ex.Message);
return null;
}
catch (Exception)
{
throw;
}
}
有关MessageQueueException的详细信息
我明白了
消息:空消息队列错误代码-2147023169
错误代码-2147467259 但在MessageQueueErrorCode枚举中未找到该代码 -2147023169值。十六进制:800706BF -2147467259值。十六进制:80004005 关于这些代码的信息不多。只有我得到: 0x80004005-2147467259 E_失败
0x800706BF-2147023169中国呼叫失败 完整跟踪异常: 消息:-MessageQueueErrorCode-2147023169-ErrorCode-2147467259 StackTrace:
在System.Messaging.MessageQueue.MQCacheableInfo.get_ReadHandle()中 在System.Messaging.MessageQueue.ReceiveBy(字符串id,TimeSpan超时, 布尔移除、布尔比较ID、布尔throwTimeout、, MessageQueueTransaction事务,MessageQueueTransactionType 交易类型) 在System.Messaging.MessageQueue.ReceiveByCorrelationId(字符串 correlationId,TimeSpan超时) 位于DeploymentAgent.Client.DeploymentInvoker.WaitForResponse()处 您可以尝试的事情:
您可以考虑使用<强>代码>公共< /代码> <强>而不是<代码>私有< /COD>队列。阅读以下关于公共队列优势的文章: