我看过几篇与此相关的帖子,但我没有找到问题的答案
所以我有一个客户端使用WCF netmsmq绑定向MSMQ发送消息。这很好。
我的本地IIS7(Windows 7)中托管了一个公开WCF MSMQ端点的网站。
当我从客户端发布消息时,消息没有被消耗,它们只是永远保留在队列中 UNTIL ,我手动浏览服务,之后消息被发送到托管的服务在IIS中
那么我需要做什么才能通过IIS中托管的WCF服务自动使用消息?
注意:我刚刚注意到在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>
我尝试过的事情:
我的默认网站包含以下配置:
<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>
答案 0 :(得分:1)
自动启动功能由AppFabric提供,因此您必须安装它。然后,您将能够使用与此类似的命令行,以便自动启动您的WAS应用程序:
appcmd.exe set app /app.name:YourApplication / serviceAutoStartEnabled:True / serviceAutoStartMode:All
答案 1 :(得分:0)
好的
这家伙为我节省了数小时的时间:
Paul Bahler @paulbahler
事实证明,即使将AppPool设置为自动启动......也不是显而易见......
所以这个人建议我安装App Fabric tools,然后将应用程序配置为自动启动并使其工作