WCF MSMQ binding with an IIS service - how to instantiate the service?
Asked Answered
C

3

7

I have a WCF service with netMsmqBinding. My client can send messages to my queue, and when the service is running it retrieves messages from the queue as expected. If the service is not running, messages received are queued until the service starts.

My problem is that the service does not start when a message hits the queue. The service is hosted in IIS, and so it is not instantiated until IIS receives a request. If I browse to the service then it processes the messages in the queue, but obviously this is not my desired method of processing the queue!

I expect that I need to change the service implementation, or change the IIS setup, but I do not know where or what to change.

UPDATE

Does anyone actually use MSMQ over WCF? I had this working for a short time - I enabled the binding on a different website on the same server, bizarrely - but now it has somehow stopped working again.

The only problem I am having is with the Activation of the service when there is a message in the queue. At present the queue only processes when the service is instantiated, e.g. when I browse the the .svc file. I have the net.msmq protocol enabled on the application, and I have the net.msmq binding enabled on the site... is there anything else I need to do?

Catarina answered 9/9, 2009 at 12:5 Comment(0)
S
5

You explicitly need to configure IIS for non HTTP activation. I don't know all the details of the top of my head but basically you need to use appcmd to configure and enable the net.msmq binding activation.

Check this blogpost or this screencast should give you all the details.

Shemeka answered 9/9, 2009 at 12:21 Comment(0)
F
3

This might save somebody the hours it took me: http://msdn.microsoft.com/en-us/library/ms731053.aspx

Freddafreddi answered 23/10, 2009 at 15:22 Comment(0)
C
2

I believe that my problems using MSMQ binding over WCF were mainly around IIS.

I had no end of problems using Windows XP / Server 2003 with IIS 6.

Using Windows 7 or Server 2008 with IIS 7.5 everything works well.

An even better suggestion is to run MSMQ as a managed service / Windows Service or a stand-alone application rather than under IIS.

Catarina answered 13/9, 2011 at 2:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.