How do I configure Quartz.NET host with Spring.NET

折月煮酒 提交于 2020-01-07 03:14:10

问题


I need to configure a Quartz.NET instance using Spring.NET. I haven't been able to find an example of how to do this, other than very simple cases. I don't need any of the job/trigger config since those are done via the API for us. What I need is a means to configure these settings.

quartz.scheduler.instanceName = ServerScheduler
quartz.threadPool.type = Quartz.Simpl.SimpleThreadPool, Quartz

quartz.threadPool.threadCount = 10

quartz.threadPool.threadPriority = Normal

quartz.plugin.xml.type = Quartz.Plugin.Xml.JobInitializationPlugin, Quartz

quartz.plugin.xml.fileNames = C:/Tools/Forge/DataImport/Config/quartz_jobs.xml

quartz.jobStore.type = Quartz.Impl.AdoJobStore.JobStoreTX, Quartz 

quartz.jobStore.driverDelegateType = Quartz.Impl.AdoJobStore.StdAdoDelegate, Quartz

quartz.jobStore.dataSource = ForgePlatformDatasource 

quartz.dataSource.ForgePlatformDatasource.connectionString = Server=172.20.0.113 Database=ForgeQuartz;Uid=sa;Pwd=654321

quartz.dataSource.ForgePlatformDatasource.provider = SqlServer-40 

quartz.jobStore.useProperties = true 

quartz.scheduler.exporter.type = Quartz.Simpl.RemotingSchedulerExporter, Quartz

quartz.scheduler.exporter.port = 555

quartz.scheduler.exporter.bindName = QuartzScheduler

quartz.scheduler.exporter.channelType = tcp

回答1:


According to what I remember you can set all your config details on the SchedulerFactoryObject -> QuartzProperties property.

<object name="SomeName" type="Spring.Scheduling.Quartz.SchedulerFactoryObject, Spring.Scheduling.Quartz">
   <property name="QuartzProperties">
      <dictionary>
        <entry key="quartz.scheduler.instanceName" value="ServerScheduler"/>
        <entry key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz"/>
        <entry key="quartz.threadPool.threadCount" value="10"/>
        ... and many more ...
    </dictionary>
  </property>
</object>

The API-Documentation:

    /// <summary> 
    /// Set Quartz properties, like "quartz.threadPool.type".
    /// </summary>
    /// <remarks>
    /// Can be used to override values in a Quartz properties config file,
    /// or to specify all necessary properties locally.
    /// </remarks>
    /// <seealso cref="ConfigLocation" />
    public virtual IDictionary QuartzProperties
    {
        set { quartzProperties = value; }
    }


来源:https://stackoverflow.com/questions/6875394/how-do-i-configure-quartz-net-host-with-spring-net

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