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.

Комментарии • 11

  • @patmac4230
    @patmac4230 6 месяцев назад +1

    This is a great explanation !!!

  • @antonpodolskyy6198
    @antonpodolskyy6198 Год назад +1

    Perfect explanation!

  • @yuvigowtham8086
    @yuvigowtham8086 2 месяца назад

    Hi . My thread printing 2 times in log . What to do?

  • @deltamakuba
    @deltamakuba Год назад +1

    Thanks for this Saggu

  • @rohanyadav7327
    @rohanyadav7327 3 месяца назад

    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

    • @SagguUK
      @SagguUK  3 месяца назад

      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.

    • @rohanyadav7327
      @rohanyadav7327 3 месяца назад

      @@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?

    • @SagguUK
      @SagguUK  3 месяца назад

      @@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.

  • @SuperAdilMorocco
    @SuperAdilMorocco Год назад +1

    Thx sir

  • @sensi7593
    @sensi7593 6 месяцев назад

    It's pronounced "S'k'eduler" not SHEduler

    • @SagguUK
      @SagguUK  6 месяцев назад +2

      In the US but It’s latter in British English :)