在asp.net应用程序中使用Quartz.Net

我的Quartz调度程序使用AdoDataStore作为端口555中的独立Windows服务运行.我有一个asp.net应用程序,为此调度程序安排作业.我在ASP.NET方面要做什么配置来安排工作?任何帮助是极大的赞赏.

这是服务配置,

<!-- Configure Thread Pool -->
<add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool,Quartz" />
<add key="quartz.threadPool.threadCount" value="10" />
<add key="quartz.threadPool.threadPriority" value="normal" />

<!-- Configure Job Store -->
<add key="quartz.jobStore.misfireThreshold" value="60000" />
<add key="quartz.jobStore.type" value="Quartz.Impl.AdoJobStore.JobStoreTX,Quartz" />
<add key="quartz.jobStore.useProperties" value="true" />
<add key="quartz.jobStore.dataSource" value="default" />
<add key="quartz.jobStore.tablePrefix" value="QRTZ_" />
<add key="quartz.jobStore.driverDelegateType" value="Quartz.Impl.AdoJobStore.StdAdoDelegate,Quartz" />
<add key="quartz.jobStore.lockHandler.type" value="Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore,Quartz" />
<add key="quartz.dataSource.default.connectionString" value="Server=server\MSsqlEXPRESS;Database=QuartzServerDB;Trusted_Connection=True;" />
<add key="quartz.dataSource.default.provider" value="sqlServer-20" />

<!--export this server to remoting context-->
<add key="quartz.scheduler.exporter.type" value="Quartz.Simpl.RemotingSchedulerExporter,Quartz" />
<add key="quartz.scheduler.exporter.port" value="555" />
<add key="quartz.scheduler.exporter.bindName" value="QuartzScheduler" />
<add key="quartz.scheduler.exporter.channelType" value="tcp" />

那么asp.net方面的配置怎么样?

解决方法

我认为答案 here可能有所帮助.
您可以查看Quartz.2008项目中的Example12.

您的配置文件必须如下所示:

<!-- Configure Thread Pool -->
<add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool,Quartz" />
<add key="quartz.threadPool.threadCount" value="5" />
<add key="quartz.threadPool.threadPriority" value="normal" />

<!--Configure remoting expoter-->
<add key="quartz.scheduler.proxy" value="true" />
<add key="quartz.scheduler.proxy.address" value="tcp://localhost:555/QuartzScheduler" />

有一点需要记住:你永远不会启动调度程序.

由于您在ASP.NET中托管Quartz.net,因此必须将调度程序定义为单例.

相关文章

这篇文章主要讲解了“WPF如何实现带筛选功能的DataGrid”,文...
本篇内容介绍了“基于WPF如何实现3D画廊动画效果”的有关知识...
Some samples are below for ASP.Net web form controls:(fr...
问题描述: 对于未定义为 System.String 的列,唯一有效的值...
最近用到了CalendarExtender,结果不知道为什么发生了错位,...
ASP.NET 2.0 page lifecyle ASP.NET 2.0 event sequence cha...