Full-stack dev quiz question #20

Full-stack dev quiz question #20

quizTwentieth question of the quiz for a full-stack developer is about Spring Scheduler.

 

 

A method test() should be executed with 5 minute break between executions. It means that the executions will never overlap. It must past 5 minutes since the last execution finished before the next one starts.

The scheduler from Spring is used to solve this. Which is the correct annotation usage that fulfills above requirements?

Choose one correct answer:

  1. @Scheduled(fixedRate = 5000L)
  2. @Scheduled(fixedRate = 5M)
  3. @Scheduled(fixedRate = 300000L)
  4. @Scheduled(fixedDelay = 5000L)
  5. @Scheduled(fixedDelay = 5M)
  6. @Scheduled(fixedDelay = 300000L)

For the correct answer scroll down

.

.

.

 

 

 

 

 

 

 

 

 

 

 

.

.

.

The correct answer is f. For more information check Scheduling tasks in Spring.