Skip to content

jobrunr/example-spring

Repository files navigation

JobRunr example

This repository shows an advanced example how you can integrate JobRunr with spring.io. In this example, Jobs are created via a web frontend (the webapp module) and processed in a different JVM (the processingapp module).

An easier example using spring.io can be found here

About this project

This project exists out of 3 modules:

  • core: this project contains MyService, a simple spring service with two example methods which you want to run in a backgroundserver.
  • processingapp: this app is a Spring Console application and runs indefinitely. It polls for new background jobs and processes them when they arrive. It contains only a two classes:

    the thing to note here is the application.properties where the server and the dashboard are enabled

  • webapp: this is a Spring Rest Webapp that enqueues new background jobs. It contains a simple RestController called JobController which contains some methods (= endpoints) to enqueue jobs.

How to run this project:

  • clone the project and open it in your favorite IDE that supports gradle
  • First, run the main method from the JobServerApplication in the processingapp module and also keep it running
  • Run the main method from the WebApplication in the webapp module and keep it running
  • Open your favorite browser:

About

An example on how to integrate JobRunr with Spring

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages