▶ 사용할 Quartz Scheduler 서비스를 사용하기 위해 Bean 등록을 해줍니다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | <bean name="dummyJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean" p:jobClass="com.gm.crawling.product.controller.MyAbstractJob" p:durability="true"> <property name="jobDataAsMap"> <map> <entry key="HelloJob" value-ref="HelloJob"/> </map> </property> </bean> <bean name="mailJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean" p:jobClass="com.gm.crawling.product.controller.MailJob" p:durability="true"> <property name="jobDataAsMap"> <map> <entry key="HelloJob" value-ref="HelloJob"/> </map> </property> </bean> <bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean" p:jobDetail-ref="dummyJob" p:startDelay="1000" p:cronExpression="0/30 * * * * ?"/> <bean id="mailTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean" p:jobDetail-ref="mailJob" p:startDelay="1000" p:cronExpression="0/5 * * * * ?"/> <bean id="schedulerFactoryBean" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref bean="cronTrigger"/> <ref bean="mailTrigger"/> </list> </property> </bean> | cs |
Quartz CronTrigger로 알아보는 Cron 표현식
Quartz-Scheduler Docs : http://www.quartz-scheduler.org/documentation/quartz-2.2.x/tutorials/tutorial-lesson-06
'웹개발 > Spring' 카테고리의 다른 글
[Spring] ajax 사용법 (0) | 2017.12.28 |
---|---|
[Spring] Quartz Scheduler Tutorial-2 (0) | 2017.12.20 |
[Spring] Quartz Scheduler Tutorial-1 (0) | 2017.12.19 |
[JSP] JSTL 과 EL 간단 정리 (세션처리) (0) | 2017.12.15 |
[Spring] mvc mybatis 오라클 데이터베이스 연결 설정 (0) | 2017.12.13 |