Fix For WCF NetMsmqBinding Not Picking Up Messages in Queue
Posted by Keith Elder | Posted in .Net, WCF, Web Services | Posted on 03-06-2009
Here’s the problem. When hosting WCF services using the NetMsmqBinding in IIS7/WAS (Windows Activation Service) the application times out after 20 minutes. While this isn’t the problem and is the default behavior in IIS it leads to the problem. When the application is timed out, if a new message arrives in the queue, the WCF service remains idle. In other words messages will just pile up in the queue (not good!).
After contacting support about this issue I finally got back some information on how to address this issue so I’m posting it in case someone else runs into this issue. Here is what you should do if you run into this problem.
- Ensure that the queue is named as virtual directory/serviceName.svc. So if your application is at http://localhost/myTest/myTest.svc, the queue name should be myTest/myTest.svc. We also should ensure that the WCF endpoint address reflects this queue name
- Both the IIS worker process (App Pool) and the Net.Msmq Listener service should use the same account, this account must also have Peek and Receive rights on the queue (but it’s better to just give it full control). You can verify the account used by your web service by checking the account used by w3wp.exe in task manager
- Ensure that the Net.Msmq listener is running using an unrestricted token, the following command should work “sc sidtype netmsmqactivator unrestricted”
- Add a DWORD called “AllowNonauthenticatedRpc” to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSMQ\Parameters\security, and set it to 1
Hope this helps someone, and if I find any other information, I’ll keep this updated.
Issue in .NET 4.5, not workaround ?
http://blogs.msdn.com/b/distributedservices/archive/2011/11/11/wcf-and-msmq-integration.aspx#comments
Net.Msmq Binding Not Picking Up Messages
in Queue as soon as the application pool gets recycled
https://social.msdn.microsoft.com/Forums/vstudio/en-US/17d3638e-92bf-49c1-9b08-5050a58d09c4/netmsmq-binding-not-picking-up-messages-in-queue-as-soon-as-the-application-pool-gets-recycled?forum=wcf
Quite inspiring,
It worked thanks puting a post on it
Thanks