Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET WCF C#4.0 .NET4
I have two WCF services, which use the net.msmq protocol and hosted in IIS 7.
My problem is that the services do not activate when a new message appears on the queue. We have to manually browse the services first before they start picking up any messages.
 
Is there any way to auto activate these services?
 
Thanks in advance for any help.
Posted 11-Jul-13 1:55am
Edited 11-Jul-13 3:03am
v2
Comments
Mohammed Hameed at 11-Jul-13 8:06am
   
Though it is a good question but I suggest you to try solving yourself. For this, you might have to understand how MSMQ works in Wcf.
saumil.sapariya at 11-Jul-13 8:14am
   
I should notice that it appears when application pool (IIS) recyled.If you have suggestion plz provide :)

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This is do-able with the combination of .Net 4 and IIS7.5.
 
First you need to auto start the application pool.
 
Configure Automatic Startup for an Application Pool (IIS 7)[^]
 
Then you need to configure the application to auto start:
 
Auto-Start ASP.NET Applications (VS 2010 and .NET 4.0 Series)[^]
 
If you don't have access to these components then you'll be required to keep the application alive by other means. Such as the following code snippet in a windows service:
 
WebClient refresh = new WebClient();
try {
    refresh.UploadString("http://www.website.com/", string.Empty);
}
catch (Exception ex) {
    //snip...
}
finally {
    refresh.Dispose();
}
 
Which I got from this article, discussing the keep alive problem.
 
Keep Your Website Alive (Don’t Let IIS Recycle Your Website)![^]
 
There are a number of settings on the IIS application pool which control recycling of the worker processes.
 
Understanding these can also help reduce the number of times the application shuts down.
 
Recycling Settings for an Application Pool[^]
 
Although if you want my advice. I'd completely drop IIS and develop a self hosted WCF application. Then the problem will just disappear.
 
How to: Host a WCF Service in a Managed Application[^]
  Permalink  
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 390
1 Jochen Arndt 150
2 Richard MacCutchan 135
3 DamithSL 95
4 Garth J Lancaster 90
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,260


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 11 Jul 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100