Unlocking the Power of Scheduled Jobs in Spring Boot

āđāļŠāļĢāđŒ
āļāļąāļ‡
  • āđ€āļœāļĒāđāļžāļĢāđˆāđ€āļĄāļ·āđˆāļ­ 4 āļŠ.āļ„. 2024
  • Today we have another bit of a fullstack demo for those new to using Java Spring Boot. We'll be looking at Scheduled Jobs, also known as Scheduled Tasks.
    There are 3 options when using Scheduled in Java Spring Boot, and we'll go through all 3:
    1. FixedDelay - The same thread executes the Job. If the thread is busy when the next execution is timed to occur, Spring Boot will wait until the thread is complete
    2. FixedRate - The Job is executed by a different thread, with the help of "Async" annotation. This means that even when a Job has not finished before the next execution is launched, Spring Boot will create it using a different thread
    3. Cron - Similar to Unix / Linux sysadmin work, we can use a "cron" expression to schedule a Job
    I hope you have a lot of fun with this project, and that it inspires you to pursue your own creative design!
    👉👉Grab the source! github.com/wazooinc/spring-bo...
    🔗Grab My Other Products Available:
    - Packaging a JavaScript Frontend in Java Spring Boot: t.ly/gaKyT
    - Build Your First Web Service with Java Spring Boot: t.ly/iv_84
    👋ðŸŧConnect with me:
    Twitter: / eyuzwa
    🔗References:
    - Docker Desktop Client: www.docker.com/
    - Cron Reference: crontab.cronhub.io/
    ===---=== Chapters ===---===
    00:00 - Introduction
    00:13 - What are Scheduled Jobs?
    01:14 - Generate Project
    02:05 - Setting up Project Basics
    06:01 - Sketching out the ProductInventoryJob
    07:45 - a FixedDelay Scheduled Job
    09:40 - @EnableScheduling
    10:55 - a FixedRate Scheduled Job
    12:42 - @EnableAsync
    13:18 - Checking the Database
    14:31 - a Cron Scheduled Job
    #springboot #docker #scheduledjobs
  • āļ§āļīāļ—āļĒāļēāļĻāļēāļŠāļ•āļĢāđŒāđāļĨāļ°āđ€āļ—āļ„āđ‚āļ™āđ‚āļĨāļĒāļĩ

āļ„āļ§āļēāļĄāļ„āļīāļ”āđ€āļŦāđ‡āļ™ • 7

  • @wazoowebbytes
    @wazoowebbytes  āļ›āļĩāļ—āļĩāđˆāđāļĨāđ‰āļ§ +2

    It's about "Time" we covered scheduled jobs! Hope this was useful for your current project!

  • @tomaszw6449
    @tomaszw6449 7 āļŦāļĨāļēāļĒāđ€āļ”āļ·āļ­āļ™āļāđˆāļ­āļ™

    Thanks for the video. Big thumbs up!👍👍👍

    • @wazoowebbytes
      @wazoowebbytes  7 āļŦāļĨāļēāļĒāđ€āļ”āļ·āļ­āļ™āļāđˆāļ­āļ™

      thanks so much! I appreciate that!

  • @abdu5822
    @abdu5822 āļ›āļĩāļ—āļĩāđˆāđāļĨāđ‰āļ§ +1

    Please create a very detailed course series for beginners to professional level on spring boot, mysql, Database design, migrations, caching, redis, docker. You can build one big project from small to complete or small projects to explain and show demos. Please.

    • @wazoowebbytes
      @wazoowebbytes  āļ›āļĩāļ—āļĩāđˆāđāļĨāđ‰āļ§

      thanks for the suggestion, that's some good ideas!

  • @serhiisterniichukda-0131
    @serhiisterniichukda-0131 10 āļŦāļĨāļēāļĒāđ€āļ”āļ·āļ­āļ™āļāđˆāļ­āļ™ +1

    Hi, thank you for tutorial! Btw, why did you use Atomic integer? Is there any benefits of using .forEach() instead of for-i in this case?. In for-i loop you could use a simple primitive int.

    • @wazoowebbytes
      @wazoowebbytes  10 āļŦāļĨāļēāļĒāđ€āļ”āļ·āļ­āļ™āļāđˆāļ­āļ™ +1

      No real benefit - at first I thought it might be safer given that it's running in a job context, but I updated the git repo with your suggestion and it also seems to work just fine. Thanks a lot for the feedback!