Spring Scheduler Tutorial
HTML-код
- Опубликовано: 26 ноя 2024
- In Spring Framework, a scheduler is a mechanism that allows you to schedule and execute tasks at specific times or with a certain frequency. The Spring framework provides a scheduling feature through the TaskScheduler and @Scheduled annotation, which are used for scheduling tasks, often known as jobs or cron jobs.
This is a great explanation !!!
Perfect explanation!
Hi . My thread printing 2 times in log . What to do?
Thanks for this Saggu
Hi Jasvinder, we are using scheduler to perform health checks on external api -
1) is this a good idea to use scheduler to check if any website is up ? How long it is going to run then ?
2) is there any way we can stop the scheduler. Because our scheduler will be running every 10 secs
Please answer. Thanks
Hi, proactively checking the health of an external service using a scheduler is a good practice. In Spring, you can stop schedulers programmatically at runtime if needed. For more details, you can refer to the official Spring scheduler documentation.
@@SagguUK hi ... did schedulers running in background make application slow? I think if it runs infinitely that will be very bad for your application. I don't find running schedulers in background for a health check is a good idea. What is your opinion?
@@rohanyadav7327 Dear Rohan, Schedulers themselves are lightweight threads, so their impact on performance is minimal. In fact, there are always multiple schedulers running in the background, often without us even noticing. The key factor that determines performance is the business logic you've implemented within the scheduler. If that logic is efficient, the scheduler should run smoothly without any issues.
Thx sir
It's pronounced "S'k'eduler" not SHEduler
In the US but It’s latter in British English :)