Hello,
How to schedule(quartz) job tier in spring batch(job, step, item)?
Is someone have an example?
I have:
I don't how to use org.springframework.batch.core.job.SimpleJob with this quartz conf?Code:<bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher"> <property name="jobRepository" ref="jobRepository" /> <property name="taskExecutor"> <bean class="org.springframework.core.task.SimpleAsyncTaskExecutor" /> </property> </bean> Also, a Quartz JobDetail is defined using a Spring JobDetailBean as a convenience. <bean id="jobDetail" class="org.springframework.scheduling.quartz.JobDetailBean"> <property name="jobClass" value="org.springframework.batch.sample.quartz.JobLauncherDetails" /> <property name="group" value="quartz-batch" /> <property name="jobDataAsMap"> <map> <entry key="jobName" value="footballJob"/> <entry key="jobLocator" value-ref="jobRegistry"/> <entry key="jobLauncher" value-ref="jobLauncher"/> </map> </property> </bean> Finally, a trigger with a scheduler is defined that will launch the job detail every 10 seconds: <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail" ref="jobDetail" /> <property name="cronExpression" value="0/10 * * * * ?" /> </bean> </property> </bean>
Thanks


Reply With Quote