I’m pleased to announce the release of JobRunr v5.0.0 (which is now available via Maven Central) and JobRunr Pro v5.0.0 which is available for customers with a subscription. As this is a major release, there are also some small breaking changes.
Some great new features to both JobRunr and JobRunr Pro!
New features in JobRunr
This release again adds quite some new improvements to JobRunr:
- Spring Native support: Thanks to @JoshLong, JobRunr now out-of-the-box supports Spring Native! Use the dependency
jobrunr-spring-boot-nativeand your app will launch in milliseconds. Stay tuned for a dedicated blog post on how to use JobRunr together with Spring Native.
- Scheduled jobs with repeating interval: since JobRunr 5.0.0, you can now schedule recurring jobs using an interval. This means you can now also schedule recurring jobs as follows:
BackgroundJob.scheduleRecurringly("my-recurring-job", Duration.parse("PT5D"), () -> service.doWork());Thank you @Daniela!
- MDC support: this release introduces support for the Mapped Diagnostics Context of SLF4J. If you have a correlation id available and you log something in your job, this correlation id will still be available. You can even use any value of the MDC context in the display name.
- Cron extended with last day of month: Need to run some jobs on the last day of the month? This is now possible thanks to @asahaf as the JobRunr Cron expression parser now supports last-day-of-week and last-day-of-month syntax.
- Default Number of Retries: You can now easily change the default number of retries via the JobRunr Spring Boot Starter, the Micronaut integration and the Quarkus Extension configuration.
- Easier integration with multiple databases: Are you running the JobRunr Spring Boot Starter, the Micronaut integration or the Quarkus Extension and do you have multiple databases available in your application (e.g. an SQL database and a Mongo DB or ElasticSearch instance)? As of JobRunr 5.0.0, you can specify which database to use in this case thanks to the extended configuration. Just specify the database
typeand JobRunr will select that database.
- MicroMeter integration: This release also adds support for MicroMeter in the JobRunr Fluent Api configuration.
- Performance improvement: Before JobRunr 5.0.0, all the recurring jobs were constantly reloaded from the StorageProvider when JobRunr checked for new work. This is now cached and only reloaded when the number of jobs changes (e.g. a delete happens).
- Dashboard ✋ Google: I noticed that there were some JobRunr dashboards publicly available and indexed by Google. As of now, the JobRunr dashboard has a
noFollowmeta tag so that your jobs stay private.
New features in JobRunr Pro
JobRunr Pro also received a lot of new features!
- Transaction plugin: are you running the JobRunr Spring Boot Starter, the Micronaut integration? Then as of v5.0.0, JobRunr out-of-the-box participates in the transactions created by these frameworks.
- Instant processing: JobRunr Pro adds some magic and now comes with instant processing of jobs. Just enqueue a job and processing will instantly begin - no need to wait for the
- Easy JobFilters: JobRunr has the concept of
JobFiltersto easily extend the functionality of JobRunr. In JobRunr Pro, this becomes even easier as any Spring / Micronaut / Quarkus bean that implements the
JobServerFilterwill automatically be registered in JobRunr.
- Improved serverTags: JobRunr Pro uses
ServerTagsto specify on which server a
Jobcan run. From now on, you can even limit to run a job on the same server that scheduled it using the annotation
@Job(runOnServerWithTag = "%CURRENT_SERVER")
- enqueueOrReplace and scheduleOrReplace: are you creating jobs with your own UUID? By default, JobRunr ignores any new job that is enqueued or scheduled if it was already created before as it allows to process jobs in a cluster only once. But do you need to replace that job for some reason? Using the new
scheduleOrReplacemethods it is now possible to update existing jobs at any point in the lifecycle of that job.
- Job Results: do you want to return the result from your job to a client? JobRunr Pro now captures the result of a job, serializes it to JSON and saves it to the database. Using the JobScheduler, you can then query for the result of a job. It comes with a smart query algorithm that takes into account average processing time of that type of job and it makes sure that you don’t overload the database if you for example have clients querying for the result in a while loop.
- Dashboard improvements: the JobRunr Pro dashboard has improved a lot! You can now requeue or delete all failed jobs at once. A real time-saver.
- all existing recurring jobs are not compatible anymore due to the support for recurring jobs using an interval. Please make sure to have no recurring jobs nor scheduled jobs in your application before upgrading.
- the job metadata is now cleared as soon as the job succeeded. There are 2 reasons for this: storage savings in your storage provider and the fact that it was used to return results from jobs without any back-off policy and thus negatively impacting the performance of JobRunr. But, JobRunr Pro now supports returning results from jobs!
- if you are using ElasticSearch, you will need to update your ElasticSearch dependencies as a bug was introduced by Elastic in ElasticSearch 7.16
- all dependencies have been updated to the latest version - make sure to upgrade your dependencies too.
👏 Special thanks to …
Daniela Tumbraegel, ShawnNest for the PR’s and Josh Long fun pairing session to add support for Spring Boot Native - the Spring guys are really amazing! I also want to thank Pei-Tang and Jan Holger for sponsoring me and making sure I have enough caffein!
All improvements & bugfixes
- GitHub issue 291: Support for latest ElasticSearch version
- GitHub issue 296: Support for latest version of H2 Database
- GitHub issue 317: Incrementing successful jobs fails on MySQL
- GitHub issue 321: Documentation improvements
- GitHub issue 324: JobRunr Pro - Dashboard improvements
- GitHub issue 326: Allow injecting logging metadata (MDC), e.g. when jobs throw exceptions
- GitHub issue 343: Spring Boot Actuator health check returning 503 status for servers with
- GitHub issue 344: Performance improvement: only reload recurring jobs on change
- GitHub issue 346: Updated documentation
- GitHub issue 350: Run job on the server that created it
- GitHub issue 351: JarFileSystem not disposed after running migrations
- GitHub issue 356: Allow to run database migrations manually.
- GitHub issue 361: Support for MicroMeter metrics in the fluent API.
- GitHub issue 363: Allow to update/replace jobs.
- GitHub issue 368: JobRunr does not use my default
DataSourcein case of multiple supported databases.
- GitHub issue 374: Configure the default number of retries in Spring / Micronaut / Quarkus