Add the annotation that will make the method asynchronous.
Java
@Component
public class JobScheduler {
__________
@Scheduled(fixedRate = 1000)
public void startJob() {
System.out.println("Job Started!");
}
}
Kotlin
@Component
class JobScheduler {
__________
@Scheduled(fixedRate = 1000)
fun startJob() {
println("Job Started!");
}
}