Reputation:
I have an asp.net MVC web application that requires tasks to be scheduled. (A large chunk of functionality is scheduled)
I am using Quartz.net as my scheduler and am currently running it as a windows service. Clustering to handle load and performing resource intensive tasks out of peak hours
The problem I face is to be able to schedule all the required functionality I have to include everything in the scheduler service including all assemblies and most of the mvc base ( e.g using the MVC views to generate email reminder templates ) so the service becomes a duplication of the web application with lots of additional code to make it play nice. This is becoming a bit of a nightmare.
So I can?
1) Configure the scheduler to work within asp.Net MVC.
2) Use a Widows service that calls the required web page.
3) Use current service design.
my preference is probably #1 as this will resolve all of the above issues but the web app will get recycled/stopped if there is no activity for some time, This means that scheduled jobs may not be executed (only if there was some activity around the time when the job should be run). Quartz.net setup in an asp.net website
Any thoughts/suggestions as to which is the best approach or any alternatives?
Upvotes: 2
Views: 1574
Reputation: 29956
I would definitely avoid option 1. Your website should be request and response, nothing more.
If the action performed by your service is not 'long running' and can reasonably be performed as part of the request/response cycle of an HTTP request, then option 2 is reasonable. This should really be a web service rather than web page call, however (this is easier to do in OpenRasta which makes no distinction between web sites and web services).
If your scheduled action is intensive/long running then it ought to be done outside the website and your current architecture is probably ok. The replication of assemblies isn't really a problem (disk space is cheap).
Upvotes: 2