Hi,
I'm using a SimpleJobLauncher with SimpleAsyncTaskExecutor to run a batch with a daily cron. The cron runs at the proper time, but it runs like 60 times in a row for some odd reason. I've invoked the jobLauncher manually and insured that my code doesn't actually run the batch 60 times. Any ideas what it could be? My config is below:
Thank you in advance!Code:<beans:bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher" > <beans:property name="jobRepository" ref="jobRepository"/> <beans:property name="taskExecutor"> <beans:bean class="org.springframework.core.task.SimpleAsyncTaskExecutor" /> </beans:property> <beans:bean id="exportUserListTasklet" class="com.foo.batch.jobs.userlist.ExportUserList" /> <batch:job id="exportUserListJob" job-repository="jobRepository"> <batch:step id="exportUserListJobStep0"> <batch:tasklet ref="exportUserListTasklet" transaction-manager="jobRepository-transactionManager" /> </batch:step> </batch:job> <task:annotation-driven executor="taskExecutor" /> <task:executor id="taskExecutor" pool-size="5-25" queue-capacity="100" rejection-policy="DISCARD" /> <task:scheduler id="taskScheduler" pool-size="10"/> <!-- TASKS --> <beans:bean id="exportUserListTask" class="com.foo.tasks.ExportUserListTask"> <beans:property name="buildEnvironment" value="${BUILD_ENVIRONMENT}" /> </beans:bean> </beans:bean> <task:scheduled-tasks scheduler="taskScheduler"> <task:scheduled ref="exportUserListTask" method="run" cron="* 1 21 * * *" /> </task:scheduled-tasks>


Reply With Quote