@Scheduled(cron="${batch.greeting.cron}") public void cronJob(){
  logger.info("> cronJob");
  Collection<Greeting> greetings=greetingService.findAll();
  logger.info("There are {} greetings in the data store.",greetings.size());
  logger.info("< cronJob");
}

@ Scheduled ( cron = "${batch.greeting.cron}" ) public void cronJob ( ) { logger . info ( "> cronJob" ) ; Collection < Greeting > greetings = greetingService . findAll ( ) ; logger . info ( "There are {} greetings in the data store." , greetings . size ( ) ) ; logger . info ( "< cronJob" ) ; }
use a cron expression to execute logic on a schedule . expression : second minute hour day - of - month month weekday
