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.

We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.