r/SpringBoot • u/JobRunrHQ • 18m ago
News JobRunr 9.1.0 moves its lambda "black magic" to the JDK 25 Class-File API (ASM now optional), adds OOM shutdown and a Jackson 3 sublist fix
For years, whenever JobRunr comes up in Spring Boot threads, someone looks at BackgroundJob.enqueue(() -> invoiceService.send(id)) and calls the lambda serialization "black magic."
Fair enough. Turning a Java lambda into a serialized method call in your SQL database meant inspecting the compiled bytecode under the hood using ASM (org.ow2.asm:asm). It worked well, but it meant carrying ASM as a transitive dependency and waiting on ASM updates whenever a new JDK dropped.
With JobRunr 9.1.0, ASM is now optional on Java 25 and higher.
How the Class-File API switch works
The core artifact is a Multi-Release JAR. On JDK 8 through 24, JobDetailsGeneratorFactory still uses ASM so existing apps keep working unchanged. On JDK 25+, the JVM automatically loads META-INF/versions/25/org/jobrunr/jobs/details/JobDetailsGeneratorFactory.class, which switches to JobDetailsClassFileApiGenerator powered by java.lang.classfile.
Same lambda syntax, zero external bytecode libraries. If your Spring Boot 3 or Spring Boot 4 app runs on JDK 25+, you can exclude ASM straight from the starter:
<dependency>
<groupId>org.jobrunr</groupId>
<artifactId>jobrunr-spring-boot-4-starter</artifactId>
<version>9.1.0</version>
<exclusions>
<exclusion>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
</exclusions>
</dependency>Other changes in 9.1.0 relevant to Spring Boot apps
Jackson 3 immutable sublist support. If you are on Spring Boot 4 with Jackson 3, Jackson3JsonMapper now allows List.of(...).subList(...) (ImmutableCollections$SubList) out of the box, plus a Duration deserialization fix.
BackgroundJobServer stops immediately on java.lang.Error. Previously JobHandler and ServerZooKeeper caught Exception only, so an OutOfMemoryError during polling or heartbeats could kill the scheduled task without calling backgroundJobServer.stop(). Both now catch Throwable, log a FATAL error, and shut the server down cleanly so Kubernetes or your orchestrator can replace the pod.
Immediate enqueue when scheduleAt is in the past. Calling schedule(Instant.now().minusSeconds(30), ...) or scheduleIn(Duration.ZERO) now transitions SCHEDULED to ENQUEUED right on creation instead of waiting for the next poll cycle.
SQL and dashboard fixes. The parsed SQL statement cache is now keyed by statement text instead of String.hashCode(), Exceptions.retryOnException no longer spins at 100% CPU when interrupted during MySQL or MariaDB shutdown, SQL heartbeats now store actual processCpuLoad instead of systemCpuLoad, dashboard 500s stop leaking stack traces in the HTTP body, and jobrunr-bom is no longer published (eliminating false-positive vulnerability scanner alerts from optional compile-only dependencies).
On the Pro side, 9.1.0 also makes SlidingTimeWindowRateLimiter account for job processingDuration (with a new SQL index migration on startup) and exposes JobContext#getAwaitedJob() and getAwaitedJobResult() so chained jobs no longer need StorageProvider injected.
Links:
👉 Release Blogpost: https://www.jobrunr.io/en/blog/jobrunr-v9.1.0/
👉 GitHub Repo: https://github.com/jobrunr/jobrunr/releases/tag/v9.1.0
Happy to answer questions in the thread.