Using Quartz.Net in asp.net application
I've the Quartz scheduler uses AdoDataStore running as a stand alone windows service in port 555. I've an asp.net application that schedule jobs for this scheduler. What are the configurations I've to do in the ASP.NET side to schedule jobs? Any help is greatly appreciated.
This is the service configuration,
<!-- 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" val开发者_开发技巧ue="555" />
<add key="quartz.scheduler.exporter.bindName" value="QuartzScheduler" />
<add key="quartz.scheduler.exporter.channelType" value="tcp" />
So how would be the configuration in the asp.net side?
I think the answer here might help. You can have a look at Example12 in Quartz.2008 project.
Your configuration file must be like this:
<!-- 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" />
One thing to remember: you'll never start the scheduler.
Since you're hosting Quartz.net in ASP.NET you have to define your scheduler as singleton.
精彩评论