Skip to content

Latest commit

 

History

History

scheduling

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

scheduling

A basic Spring Boot application that showcases scheduling using the @Scheduled annotation.

Instructions

Follow these instructions to build and run the example program.

  1. Pre-requisite: Java
    • I used Java 21
  2. Build the program distribution
    • ./gradlew installDist
  3. Run the app:
    • ./build/install/scheduling/bin/scheduling
    • Notice how the custom "Spreading good vibes!" message is printed every 10 seconds.
    • 2024-04-05T00:31:24.570-05:00  INFO 36375 --- [           main] d.spring_playground.scheduling.Main      : Started Main in 0.368 seconds (process running for 0.529)
      2024-04-05T00:31:25.013-05:00  INFO 36375 --- [   scheduling-1] d.s.scheduling.GoodVibesService          : Spreading good vibes!
      2024-04-05T00:31:35.004-05:00  INFO 36375 --- [   scheduling-1] d.s.scheduling.GoodVibesService          : Spreading good vibes!
      2024-04-05T00:31:45.002-05:00  INFO 36375 --- [   scheduling-1] d.s.scheduling.GoodVibesService          : Spreading good vibes!
      
  4. Stop the app.
    • Use the Ctrl+C key combination to stop the Gradle run task.

Reference