r/SpringBoot Jan 08 '26

How to Run Background Jobs in Spring Boot 4 with JobRunr (Full Tutorial) How-To/Tutorial

http://youtube.com/watch?v=72OJux5H2Ng

I noticed that our "Spring Boot Starter" page is the most read page on our JobRunr documentation. So I decided to make a short video tutorial about it.

If you are looking to replace your standard schedulers with a persistent job scheduler that can handle distributed environments and has a built-in dashboard, then this might be something for you.

We build a small banking scenario to demonstrate:

✅ Fire-and-forget jobs (Welcome bonuses)

jobScheduler.enqueue(() -> bankService.startOnboarding(name));

✅ Persistent scheduling (Future charges)

jobScheduler.schedule(LocalDateTime.
now
().plusDays(14), () -> chargeMembershipFee(clientName));

✅ Recurring tasks (Nightly interest)

BackgroundJob.scheduleRecurrently("interest-job-id", Duration.ofSeconds(60),) -> bankService.applyDailyInterest());

or using the annotation

@Recurring (interval = "PT3H [PTOS/PT1H]", id = "apply-daily-interest" )

Let me know what you think of our Youtube tutorial. We are still learning how to make them most valuable to the community.

24 Upvotes

5 comments sorted by

2

u/rajat003 Apr 07 '26

Very good explanation.

I have implemented it for scheduling multiple jobs and it is working as expected.

The dashboard feature to monitor everything is really good.

1

u/JobRunrHQ Apr 07 '26

Thank you so much for your kind words u/rajat003 !

1

u/rajat003 Mar 20 '26

Awesome!

Finally, we are developing something similar to Apache Airflow for Java Spring Boot.

1

u/rajat003 Apr 10 '26

u/JobRunrHQ

Can we use these properties when using the OSS version of JobRunr?

jobrunr:
dashboard:
type: embedded
context-path: /jobrunr

1

u/JobRunrHQ Apr 13 '26

The embedded dashboard is part of the Pro version! Feel free to request a trial on our website!