Same Quartz.Net scheduler in multiple app server.

 ̄綄美尐妖づ 提交于 2019-12-02 09:59:09

I found my own solution in this page ;

Quartz.NET Clustering

I duplicate my console app and change port address (1 : localhost:555 port , 2 : localhost:556 port ) , create six jobs three of them run in 30 sec , others run in 60 sec.we run them in same time and here what quartz do ;

running same PC Console App

and my properies ;

<quartz>
    <add key="quartz.scheduler.instanceName" value="RemoteServer"></add>
    <add key="quartz.scheduler.instanceId" value="AUTO"></add>
    <add key="quartz.jobStore.clustered" value="true"></add>
    <add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz"></add>
    <add key="quartz.threadPool.threadCount" value="5"></add>
    <add key="quartz.threadPool.threadPriority" value="Normal"></add>

    <!-- Tcp Hosting-->
    <add key="quartz.scheduler.exporter.type" value="Quartz.Simpl.RemotingSchedulerExporter, Quartz"></add>
    <add key="quartz.scheduler.exporter.port" value="556"></add>
    <add key="quartz.scheduler.exporter.bindName" value="QuartzScheduler"></add>
    <add key="quartz.scheduler.exporter.channelType" value="tcp"></add>
    <add key="quartz.scheduler.exporter.channelName" value="httpQuartz"></add>

    <!-- DB-->
    <add key="quartz.jobStore.type" value="Quartz.Impl.AdoJobStore.JobStoreTX, Quartz"></add>
    <add key="quartz.jobStore.useProperties" value="true"></add>
    <add key="quartz.jobStore.dataSource" value="myDS"></add>
    <add key="quartz.jobStore.tablePrefix" value="[dbo].QRTZ_"></add>
    <add key="quartz.jobStore.driverDelegateType" value="Quartz.Impl.AdoJobStore.SqlServerDelegate, Quartz"></add>
    <add key="quartz.dataSource.myDS.connectionString" value="Data Source=xxx;Initial Catalog=xxx;User ID=xxx;Password=xxx"></add>
    <add key="quartz.dataSource.myDS.provider" value="SqlServer"></add>
    <add key="quartz.serializer.type" value="binary"></add>

Thank you !

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!