Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/338.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在石英晶体中使用批处理模式_Java_Spring_Quartz Scheduler - Fatal编程技术网

Java 在石英晶体中使用批处理模式

Java 在石英晶体中使用批处理模式,java,spring,quartz-scheduler,Java,Spring,Quartz Scheduler,为了提高石英的性能,我打算按照中的建议在石英中使用配料 我们与spring集成创建了quartz调度程序,如下所示 <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <!-- Quartz requires a separate 'quartz.properties' file --> <property name="configLoca

为了提高石英的性能,我打算按照中的建议在石英中使用配料

我们与spring集成创建了quartz调度程序,如下所示

<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
        <!-- Quartz requires a separate 'quartz.properties' file -->
        <property name="configLocation" value="classpath:/quartz.properties"/>

        <!-- Naturally, Quartz with the DB requires references
              to the data source and transaction manager beans -->
        <property name="dataSource" ref="quartzDataSource"/>
        <!--<property name="transactionManager" ref="transactionManager"/>-->

        <!-- reference to our 'autowiring job factory bean', defined above: -->
        <property name="jobFactory" ref="quartzJobFactory"/>

        <!-- Boolean controlling whether you want to override
              the job definitions in the DB on the app start up.
              We'll talk about it more in the next section. -->
        <property name="overwriteExistingJobs" value="true"/>

        <!-- I will not explain the next three properties, just use it as shown: -->
        <property name="autoStartup" value="${isQuartzEnabled}" />
        <property name="schedulerName" value="quartzScheduler"/>
        <property name="applicationContextSchedulerContextKey" value="applicationContext"/>

        <!-- Controls whether to wait for jobs completion on app shutdown, we use 'true' -->
        <property name="waitForJobsToCompleteOnShutdown"
                  value="true"/>

        <!-- Tell the Quartz scheduler about the triggers.
              We have implemented the 'quartzTriggers' bean in the 'Jobs and triggers' section.
              No need to pass job definitions, since triggers created via Spring know their jobs.
              Later we'll see a case when we'll have to disable this and pass the jobs explicitly.-->
        <property name="triggers" ref="quartzTriggers"/>

    </bean>


如何在DirectSchedulerFactory中指定的maxBatchSizebatchTimeWindow

我发现,可以通过在quartz.properties文件中配置以下属性来实现

org.quartz.scheduler.batchTriggerAcquisitionMaxCount

参考资料:

  • org.quartz.scheduler.batchTriggerAcquisitionFireAheadTimeWindow
    将设置
    batchTimeWindow
  • org.quartz.scheduler.batchTriggerAcquisitionMaxCount
    将设置
    maxBatchSize
    属性
资料来源: