Skip to content

Latest commit

 

History

History
39 lines (34 loc) · 2.03 KB

README.md

File metadata and controls

39 lines (34 loc) · 2.03 KB

JobRunr Micronaut example

This repository shows an example how you can integrate JobRunr and Micronaut.

About this project

Micronaut and JobRunr integration

To integrate JobRunr into Micronaut:

  • just add the dependency: org.jobrunr:jobrunr-micronaut-feature:LATEST
  • make sure that you configure JobRunr in the micronaut application.yml
jobrunr:
  job-scheduler:
    enabled: true
  background-job-server:
    enabled: true
  dashboard:
    enabled: true

Package structure

This project has the following packages:

  • org.jobrunr.examples: this package contains the application class that bootstraps the Micronaut app.
  • org.jobrunr.examples.services: this package contains MyService, a simple @Singleton service with some example methods which you can run in the background.
  • org.jobrunr.examples.webap.api: this package contains the following http resource:
    • JobController: this resource contains a couple of REST api's which allows you to enqueue new Background Jobs

How to run this project:

  • clone the project and open it in your favorite IDE that supports Maven
  • Set the environment variable JOBRUNR_JOBS to true if you want to run the jobs (by default it's false)
    • You can also just update application.yml to by pass the requirement for an env var
  • Run the Maven plugin ./gradlew run and wait for Micronaut to be up & running
  • Open your favorite browser:

Note: Running micronaut apps with JobRunr using GraalVM native mode is not yet supported.