WCF - MSMQ端点在新环境中未找到

3

设置

我有一个托管在 Windows Server 2012R2 的 IIS/AppFabric 上运行的 WCF 服务。 该服务通过 netMsmqBinding 绑定到本地事务性 MSMQ 队列。我的操作使用 TransactionScopeRequired = true 进行装饰。 该服务操作接收来自 BizTalk 服务器的调用,处理它们并通过 netMsmqBinding 将响应发送回远程队列(位于同一 BizTalk 服务器上)。

<endpoint name="Outbound" address="net.msmq://int01test.mydomain.com/private/queue.name" binding="netMsmqBinding"  bindingConfiguration="QueueBindingConfigurationOutbound" contract="My.Outbound.Contract" /> 



<netMsmqBinding>
<binding name="QueueBindingConfigurationOutbound">
<security>
<transport msmqAuthenticationMode="WindowsDomain" msmqProtectionLevel="Sign" />
</security>
</binding> 
</netMsmqBinding>
在测试环境中,这个方案可以正常工作。
测试环境的物理设置如下: Server int01test.mydomain.com 托管一个 BizTalk 服务器和我的入站队列。 这在服务帐户 mydomain\inttestuser 下运行。 Server app01test.mydomain.com 托管我的应用程序(IIS/AppFabric)、我的数据库(SQL server)和我的出站队列。 这在服务帐户 mydomain\apptestuser 下运行。
问题: 当此解决方案升级到接受测试环境时,调用仍然被处理,但响应被阻止,并显示错误消息:
System.ServiceModel.EndpointNotFoundException: An error occurred while opening the queue:Unrecognized error -1072824317 (0xc00e0003). The message cannot be sent or received from the queue. Ensure that MSMQ is installed and running. Also ensure that the queue is available to open with the required access mode and authorization. ---> System.ServiceModel.MsmqException: An error occurred while opening the queue:Unrecognized error -1072824317 (0xc00e0003). The message cannot be sent or received from the queue. Ensure that MSMQ is installed and running. Also ensure that the queue is available to open with the required access mode and authorization.
区别: 在测试环境中,我的服务和数据库运行在单个服务器实例上。(BizTalk Server 及其队列是在另一台服务器上) 在接受测试环境中,我的解决方案部署在两个负载均衡服务器上,数据库在一个单独的集群中。 还有更严格的外部防火墙规则以模仿生产环境。 即使 BizTalk 服务器已经被集群化,我们现在是机器对机器通信,而不是集群对集群通信。
因此,在 QA 环境中的设置如下: Server int01qa.mydomain.com(与 int02qa.mydomain.com 集群)托管 BizTalk 服务器和我的入站队列。 这在服务帐户 mydomain\intqauser 下运行。 Server app01qa.mydomain.com(与 app02qa.mydomain.com 集群)托管我的应用程序(IIS/AppFabric)和我的出站队列。 这在服务帐户 mydomain\appqauser 下运行。 Server db01qa.mydomain.com 托管我的数据库。
我们已经尝试过的方法: - 我们已禁用远程队列的身份验证。 - 我们已授予运行我的服务的帐户以及“everyone”完全控制权。 - 我们已成功地在两台服务器之间手动发送 MSMQ 消息。 - 我已将我的服务配置为将响应发送到本地私有队列,但仍然出现相同的错误。

为了消除权限问题,您需要添加“匿名登录”以及“所有人”(后者不包括前者)。 - John Breakwell
请问您能否提供各种资源的名称(如有必要,可以使用虚假名称),以便更容易地讨论各种资源和服务的物理位置? - John Breakwell
匿名访问已经被授权。但这并没有帮助到问题的解决。 - Guran
anon bit 只是为了完整性。关于额外的信息,您已经提供了服务器名称,但没有提供集群资源。如果您已经将 MSMQ 集群化,则不应在 int01qa 上运行它,而应作为集群资源运行。MSMQ 可以在 int01qa 上安装,但不要启动服务。我的假设是队列不在您认为它们所在的位置。(https://blogs.msdn.microsoft.com/johnbreakwell/2008/02/18/clustering-msmq-applications-rule-1/) - John Breakwell
@JohnBreakwell 感谢您的所有帮助。尽管问题实际上并不在聚类中,但您帮助我排除了一些错误的线索。 - Guran
显示剩余3条评论
2个回答

2
问题出在 MSMQ 找不到应用程序池用户的证书。也就是说,0xc00e0003,MQ_ERROR_QUEUE_NOT_FOUND 实际上是由 0xC00E002F,MQ_ERROR_NO_INTERNAL_USER_CERT 引起的。将安全设置更改为...
<transport msmqAuthenticationMode="None" msmqProtectionLevel="None" />

启用消息发送功能。 当然,真正的解决方案并不是禁用安全性,而是确保应用程序池用户证书已安装在 MSMQ 中。


这里有一些提示:https://blogs.msdn.microsoft.com/johnbreakwell/2009/01/23/how-to-send-authenticated-msmq-messages-without-using-a-domain-account/ - John Breakwell
1
有趣的阅读,不过我在我的服务下运行了一个域帐户。 - Guran

0

我们遇到了这个问题,但不想禁用身份验证。我们尝试了许多不同的方法,但我们认为与用户证书不存在有关。

我们去了客户端应用程序的应用程序池(通过MSMQ调用WCF端点),并将Load Profile属性更改为True。然后调用就可以工作了。顺便说一句,将其改回false仍然可以工作-可能是因为它已经解决了证书问题。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接