Skip to content

Latest commit

 

History

History

README.md

JobRunr — Quarkus Example

A Quarkus application that demonstrates three core JobRunr background job patterns using the JobRunr Quarkus Extension.

The app models a newsletter subscription service:

Endpoint Pattern What happens
POST /subscribe Fire-and-forget Confirmation email sent as soon as a worker is free
POST /confirm Delayed Welcome email scheduled for execution 3 days later
(on startup) Recurring Weekly digest sent every Monday via @Recurring

Requirements

  • Java 21+
  • Gradle (wrapper included)

Project structure

quarkus-app/
├── src/main/java/org/jobrunr/example/
│   ├── resources/
│   │   └── SubscriptionResource.java   # JAX-RS endpoints
│   └── services/
│       └── EmailService.java           # Simulated email jobs (prints to console)
└── build.gradle

Running the app

git clone https://github.com/jobrunr/jobrunr-examples.git
cd jobrunr-examples/quarkus-app
./gradlew quarkusDev

The server starts on http://localhost:8080 and the JobRunr dashboard on http://localhost:8000/dashboard.

Try it out

# Fire-and-forget: confirmation email sent immediately
curl -X POST "http://localhost:8080/subscribe?email=you@example.com"

# Delayed: welcome email scheduled 3 days from now
curl -X POST "http://localhost:8080/confirm?email=you@example.com"

How it works

See the Getting started with Quarkus guide for a full walkthrough of the code.