This repository shows an example how you can integrate JobRunr, Spring Boot 3, and Kotlin JSON Serialization.
If you are looking for an example on how to integrate JobRunr into a Java Spring Boot 3 project, please take a look at our pure Java example project: https://github.com/jobrunr/example-spring/.
This project shows how to let Spring Boot 3 + Kotlin + JobRunr play along nicely.
For more information on how JobRunr integrates with Spring, please see our extension documentation located at https://www.jobrunr.io/en/documentation/configuration/spring/.
The build.gradle
file listing the dependencies is the most important one to inspect here, that lists the following groups of dependencies:
- Spring Boot dependencies: your usual: just the
jobrunr-spring-boot-3-starter
and an optional one for testing. - Kotlin + kotlinx-serialization dependencies. Note that you need
core
,core-jvm
,json
, andjson-jvm
because of Spring. - DataSources: H2 that helps to create a Spring
dataSource
bean needed for JobRunr. - JobRunr Kotlin compatibility + Spring compatibility.
If you're unsure on which versions of kotlinx-serialization-json
and Kotlin to pick, see our serialization support announcement at https://www.jobrunr.io/en/guides/migration/v8/#kotlin-serialisation-support.
Only JobRunr v8 and up support Kotlin serialization.
- clone the project
- Run the
bootRun
Gradle task or let your favourite IDE do the heavy lifting for you - Open your favorite browser:
- Navigate to the JobRunr dashboard located at http://localhost:8000/dashboard.
- To enqueue a simple job, open a new tab and go to http://localhost:8080/jobs/ and take it for there.
- Visit the dashboard again and see the jobs being processed!