I am spawning a thread which will keep pulling the chunk of records from database and putting them into the queue. This thread will be started on the server load. I want thi
You can use the @Scheduled
annotation to run jobs. First create a class with a method that is annotated with @Scheduled
.
Class
public class GitHubJob {
@Scheduled(fixedDelay = 604800000)
public void perform() {
//do Something
}
}
Then register this class in your configuration files.
spring-context.xml
For more about scheduling visit the Spring Docs.