开发者

MVC 3 With Quartz.Net

I currently have a UI in MVC 3 that allows users and admins to configure and create Jobs, Tasks, and specific configuration values into the application. I want to implement Quartz.Net to use for scheduling, launching开发者_运维知识库, and logging job execution. I was looking for some help in configuring the MVC 3 app to use quartz. Where should I put the Quartz.Net config values? Web.Config? Or separate Quartz.Config file? I plan to use the AdoJobStor. Do I have to implement a Singleton class for using the Quartz.Net Scheduler in various areas of my MVC 3 app?

Thanks for the help.....


I would start with the tutorial.
There's pretty much everything you need to know to start with it.
You can configure quartz.net via config file or programmatically, as explained here.
Loads of useful information here in S.O.:

Configuring ADOJobStore with Quartz.net. Some more infos here and here.

Configuring logging.

If you want to use Quartz.net in you asp.net you have to use singleton schedulers.


I would not put a scheduler on a IIS-hosted application as it will eventually recycle.

This will cause the scheduler to stop until the IIS process is recreated when the website gets hit by requests. This may sound OK for high-activity websites but remember IIS may decide to recycle your scheduler at unexpected times (like in the middle of executing a task). You should move the scheduler part to a Windows Service.

Edit: http://hangfire.io/ seems like a nice way to run scheduled tasks in ASP.Net

Edit2: I'm actually using HangFire in a project. It is very easy to use and powerful.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜