스프링 스케줄러 사용법


스프링 스케줄러 사용법

import org.springframework.scheduling.annotation.Scheduled; //스케줄 //@Scheduled(fixedDelay = 1000 * 10) //10 초마다 배치 수행 @Scheduled(cron = "0 30 7 * * MON-FRI") //매일 월~금 7시 30분 배치 public void run() { System.out.println("-------배치 수행-------"); } src/main/resources/spring > context-common.xml > beans 소스 내에 아래 두줄 추가 xmlns:task="http://www.springframework.org/schema/task" http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd"> <task:annotation-driven ...



원문링크 : 스프링 스케줄러 사용법