WCF net.msmq service auto activation
Asked Answered
N

7

15

I have to WCF services which use the net.msmq protocol, hosted in IIS 7. My problem is that the services do not activate when a new message appears on the queue, you have to physically browse to the services first, before they will start picking up any messages.

Is there any way to auto activate these services?

Thanks in advance for any help

Kind Regards, Brian

Nachison answered 28/7, 2009 at 14:13 Comment(1)
We have the same problem, I am opening a support call with Microsoft to get to the bottom of them issue. I wonder if there is a way to know the exact error or reason for why it is not activatingRockies
O
3

There's a really good three-part series on getting WCF, MSMQ and IIS up and running and playing nicely together on Tom Hollander's blog:

Maybe those will help? MSMQ hosted in IIS7 should definitely be picking up the WCF messages automatically, if everything is configured correctly.

There's a few settings that aren't set out of the box - see part 1. You may need to add and enable additional Windows features, and you could need to run the appcmd.exe tool to configure WAS (Windows Activation Server, part of IIS7) to automatically handle non-http requests.

Marc

Overexpose answered 28/7, 2009 at 16:2 Comment(0)
R
3

I know it's an old post but in case someone else come by with that problem...

If the service doesn't activate once application pool has been shutdown, it is most probably because the queue name does not match de service URI and so WAS does not know which application to activate.

So for example, if you create a Application "Services" in the default web site and have a FirstService.svc, the queue name should be private$\Services/FirstService.svc

[Edit: Queue name should contain the application name also in plural]

Rubbing answered 14/1, 2011 at 14:53 Comment(1)
ok - I have confirmed that this works. Question: what should the queue be named if the application is its own site, i.e., not under the default web site?Execution
D
2

This is due to the fact that WAS will not auto-active or "warm-up" when using MSMQ. The solutions are to take a look at the IIS 7 Warm Up module or have something like a load balancer ping your service(we are using an F5 device to do this). Update - here is the link for IIS 8 App Initialization

Disfigure answered 16/1, 2011 at 20:9 Comment(2)
Your link died. Is IIS 8.0 Application Initialization the replacement?Pernell
This solution worked for me. In IIS 7.5, you'll have to download the Application Initialization module as a separate installation.Breakfast
N
0

I found that, on Windows 7 with IIS 7.5 and .NET 4.0, the NetMsmqActivator service is disabled and stopped by default. You need to enable it and start it.

Moreover, the queue must allow "Receive Message" and "Peek Message" for the account used by the application pool and for the account used by NetMsmqActivator. On a default installation, you can use IIS APPPOOL\ASP.NET v4.0 (you'll have to type it in: that's 3 'P's, take care with the spaces) and NETWORK SERVICE.

Nic answered 20/5, 2011 at 13:22 Comment(0)
W
0

We have been observing this problem for more than a month now in a system with these properties:

  • Mixed services, both http and msmq based hosted in WAS on IIS7.5
  • msmq protocol used: net.msmq
  • services not hosed in root web site, but in application underneath

We have been running through all the guidelines and problem solving tecniques involving: * Protocol setup on the iis and application level. * queue naming * security settings of queue, windows services and iis

But still the problem persisted. Our solution was to follow this: http://www.daczkowski.net/tag/wcf/ That is to install the appfabric onto our iis and setup the services for autostart.

The problem itself is rather hard to define fully, what we can say is only that "sometimes the service will stop processing from the queue"

Widely answered 25/5, 2011 at 11:11 Comment(0)
P
0

My solution is a mix off some answers here. My queue has authentication enable, so some steps may not be needed if authentication is not used.

Here is the steps i follow to put it to work, on a windows 2012:

1) Install non-http activation services WAP (https://msdn.microsoft.com/en-us/library/ms731053(v=vs.110).aspx)

2) Create queue with the same name as the IIS application, like this private$/<WCF application>/myservice.svc.

The Net.Msmq Listener Adapter service will try to match the queue and the WCF application name in IIS as pointed by VdesmedT.

3) Enable protocols on site and application.

First create the binding:

%windir%\system32\inetsrv\appcmd.exe set site "Default Web Site" -+bindings.[protocol='net.tcp',bindingInformation='808:*']

Site bindings should look like this: enter image description here

Then enable the protocol net.msmq for the site

%windir%\system32\inetsrv\appcmd.exe set config -section:system.applicationHost/sites "/[name='Default Web Site'].[path='/'].enabledProtocols":"http,net.msmq" /commit:apphost

This command will rewrite protocols, so if you have more than http enable, you need to add it to the command line.

At Advanced Settins you should see this:

enter image description here

And finally enable the protocol net.msmq for the application.

%windir%\system32\inetsrv\appcmd.exe set app "Default Web Site/" /enabledProtocols:http,net.tcp

The Advanced Settings screen for the application should show the same thing that appears on Advanced Settings for the site, at the enabled protocols line.

4) Give permissions on queue for IIS application to Read, peek and delete, get properties and set properties. The default account is IIS Apppool\DefaulApp

5) Give peek permission on queue for services Net.Msmq Listener Adapter (default is Network Service)

Shouldn't need but i had to restart after changing permissions.

Checks:

  • To check if WCF is setup properly just use the browse the WCF application to activate it. Any messages in queue should be processed.

  • To check if WAS is activating the WCF application, recycle the Application pool and send a new message. If WAS works it should be process immediately.

Prentiss answered 31/3, 2016 at 14:25 Comment(0)
I
-1

Just set the application Auto-Start to 'Enabled' in the IIS

Imprisonment answered 26/9, 2014 at 12:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.