在 asp.net 应用程序中使用 Quartz.Net
我的 Quartz 调度程序使用 AdoDataStore 作为独立的 Windows 服务在端口 555 中运行。我有一个为该调度程序调度作业的 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端如何配置呢?
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" value="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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这里的答案可能会有所帮助。
你可以看看Quartz.2008项目中的Example12。
您的配置文件必须如下所示:
要记住的一件事:您永远不会启动调度程序。
由于您在 ASP.NET 中托管 Quartz.net,因此您必须将调度程序定义为单例。
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:
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.