[英]WCF MSMQ hosted in IIS7 WAS not retrieving messages automatically until I MANUALLY hit the service
I have seen several posts related to this but I have not found an answer to my problem 我已经看到了与此相关的几篇文章,但没有找到解决我问题的答案
So I have a client sending messages to a MSMQ using WCF netmsmq binding. 因此,我有一个客户端使用WCF netmsmq绑定将消息发送到MSMQ。 This works fine.
这很好。
I have a web site hosted in my local IIS7 (Windows 7) exposing a WCF MSMQ endpoint. 我在本地IIS7(Windows 7)中托管一个网站,该网站公开了WCF MSMQ终结点。
When I publish a message from the client, the messages are not being consumed, they just stay in queue forever UNTIL , I manually browse the service, after that the messages are sent to the service hosted in IIS 当我从客户端发布消息时,消息并没有被使用,它们只是永远留在队列中直到我将消息发送到IIS中托管的服务后,我才手动浏览该服务
So what do I need to do in order to consume the messages automatically by my WCF service hosted in IIS? 那么,为了通过托管在IIS中的WCF服务自动使用消息,我需要做什么?
Note: I just noticed that after calling any WCF service hosted in my web applicaiton in IIS wakes up the service or something and suddenly the queue messages are consumed... 注意:我只是注意到,在调用IIS中我的Web应用程序中托管的任何WCF服务之后,都会唤醒该服务或某些东西 ,突然队列消息被消耗了...
<system.serviceModel>
<client>
<endpoint name="Service.ServiceContracts.QueueLoggingService NET MSMQ"
address="net.msmq://localhost/private/Service.WebHost/QueueLoggingService.svc"
binding="netMsmqBinding"
contract="Service.ServiceContracts.IQueueLoggingService">
</endpoint>
</client>
<bindings>
<netMsmqBinding>
<binding exactlyOnce="true" durable="true" maxRetryCycles="15" receiveRetryCount="15">
<security mode="None">
<message clientCredentialType="None" />
<transport msmqAuthenticationMode="None" />
</security>
</binding>
</netMsmqBinding>
</bindings>
</system.serviceModel>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true">
</serviceHostingEnvironment>
<services>
<service name="Service.ServiceImplementations.QueueLoggingService">
<endpoint
address="net.msmq://localhost/private/Service.WebHost/QueueLoggingService.svc"
binding="netMsmqBinding"
contract="Service.ServiceContracts.IQueueLoggingService">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<bindings>
<netMsmqBinding>
<binding exactlyOnce="true" durable="true" maxRetryCycles="15" receiveRetryCount="15">
<security mode="None">
<message clientCredentialType="None" />
<transport msmqAuthenticationMode="None" />
</security>
</binding>
</netMsmqBinding>
</bindings>
</system.serviceModel>
Things that I have tried: 我尝试过的事情:
My Default Web Site contains the following configuration: 我的默认网站包含以下配置:
<application path="/Service.WebHost" applicationPool="MyGenericAppPool" enabledProtocols="net.msmq, http"> <virtualDirectory path="/" physicalPath="C:\\Some Path\\Service.WebHost" /> </application> <bindings> <binding protocol="http" bindingInformation="*:80:" /> <binding protocol="net.tcp" bindingInformation="808:*" /> <binding protocol="net.pipe" bindingInformation="*" /> <binding protocol="net.msmq" bindingInformation="localhost" /> <binding protocol="msmq.formatname" bindingInformation="localhost" /> </bindings>
The autostart functionality is provided by AppFabric, so you must install it. 自动启动功能由AppFabric提供,因此您必须安装它。 Then, you will be able to use a command line similar to this one, in order to auto-start your WAS application :
然后,您将能够使用类似于此命令行的命令行,以自动启动WAS应用程序:
appcmd.exe set app /app.name:YourApplication /serviceAutoStartEnabled:True /serviceAutoStartMode:All
appcmd.exe设置app /app.name:YourApplication / serviceAutoStartEnabled:True / serviceAutoStartMode:All
OK 好
This guy saved me hours of reserching: 这个家伙节省了我几个小时的重新设置:
Paul Bahler @paulbahler 保罗·巴勒(Paul Bahler)@paulbahler
Turns out that even when the AppPool was set to Start Automatically .... it was not apperantly... 事实证明,即使将AppPool设置为“自动启动...”,它也不是正确的...
So this guy suggested me to install App Fabric tools and then just configure the application to automatically start and booooooom it worked 所以这个人建议我安装App Fabric工具 ,然后将其配置为自动启动并放大它的工作范围
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.