通过HTTP的MSMQ调用未到达目标队列 [英] MSMQ calls over HTTP not reaching destination queue

查看:100
本文介绍了通过HTTP的MSMQ调用未到达目标队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用MSMQ通信的WCF服务,当我在本地netwrok上运行该服务时,我在客户端配置文件中将服务端点配置为指向主机,例如,如果该端点在服务主机上指定是:

I have a WCF service that uses MSMQ communication, when i run the service on my local netwrok, i configure the service endpoints in the client config files to point to the host computer, for example if the endpoint specified on the service host is:

<endpoint address="net.msmq://localhost/private/MsmqService/MyMsmqService"
         binding="netMsmqBinding" bindingConfiguration="test" contract="MsmqService.IMyMsmqService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>

我将客户端配置为向该端点发送消息:

I configure my client to send messages to this endpoint:

<endpoint address="net.msmq://192.168.1.5/private/MsmqService/MyMsmqService"
         binding="netMsmqBinding" bindingConfiguration="test" contract="MsmqService.IMyMsmqService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>

很显然,192.168.1.5是主机的IP,它的工作原理像一个超级按钮.我将服务托管在IIS 7中,我在IIS上激活了MSMQ侦听器,并提供了适当的访问权限,等等(

Obviously 192.168.1.5 is the IP of the host computer, this works like a charm. I host my service in IIS 7, I activate the MSMQ listener on IIS, give appropriate access right etc (Pretty much everything in Tom Hollanders article) and I can even access my service over http in my browser, but when I create clients of my service which is hosted in IIS and configure the endpoints in the client App.config, naturally I configure my clients to this:

<endpoint address="net.msmq://ServiceHostPublicIP/private/MsmqService/MyMsmqService"
         binding="netMsmqBinding" bindingConfiguration="test" contract="MsmqService.IMyMsmqService">
        <identity>
            <dns value="localhost" />
        </identity>
</endpoint>

这就是问题所在.我发送的消息一直在客户端计算机上的传出队列中排队:DIRECT=OS:[ServiceHostPublicIP]\private$\MsmqService\MyMsmqService 并且队列的状态始终为:等待连接".我尝试将队列传输协议设置为SRMP,我的队列名称与IIS所要求的服务名称相同,并且我已经对该队列赋予了适当的权限.最近有人遇到过这个问题吗?有任何想法吗?如果有人拥有一个可以通过HTTP共享MSMQ的工作示例,那就太好了.

That's where things go wrong. The messages I send keep getting queued in an outgoing queue on the client machine: DIRECT=OS:[ServiceHostPublicIP]\private$\MsmqService\MyMsmqService and the state of the queue is always: 'Waiting to Connect'. I've tried setting the queue transfer protocol to SRMP, my queue name is the same as my service name as is required by IIS, and I've given appropriate permissions on the queue. Has anybody recently encountered this problem before? Any Ideas? It'd be great if somebody could share a working sample of MSMQ over HTTP if they had one.

任何帮助将不胜感激.预先感谢.

Any help would be greatly appreciated. Thanks in advance.

推荐答案

我设法解决此问题,我的消息被卡在客户端计算机上的传出队列中,"DIRECT = TCP:HOSTSERVERIP \ private $ \ MsmqService/MyMsmqService .svc"队列的状态为正在等待连接",而下一跳是目标服务器的公共IP,因此即使客户端可以ping通目标服务器的公共IP,客户端也无法连接到目标队列. 打开端口1801 后,MSMQ用于侦听传入流量的端口1801在服务主机所在的网络的路由器上未打开.这是一个非常基本的问题,我想许多人都不会在他们的文章/教程中提到它.希望这对以后的人有所帮助.

I managed to fix this, my messages were getting stuck in an outgoing queue on the client machine, "DIRECT=TCP:HOSTSERVERIP\private$\MsmqService/MyMsmqService.svc" the state of the queue was 'Waiting to connect' and the next hop was the destination servers public IP, so the client couldn't connect to the destination queue even though it could ping the destination servers public IP, turned out the port 1801 which is used by MSMQ to listen to incoming traffic was not open on the router of the network on which the service host machine resided, after opening port 1801 everything is working like a charm. It's such a fundamental issue that i guess many didn't bother mentioning it in their articles/tutorials. Hope this helps somebody later on.

这篇关于通过HTTP的MSMQ调用未到达目标队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆