Queues will make sure your critical business processes finish on-time.

Are you processing millions of jobs? Do you have some high-prio jobs that need to finish fast? Use JobRunr queues to make sure that critical jobs cut in front of already enqueued jobs.


Using queues could not have been easier thanks to the Job annotation. Just add it to your service method and specify on which queue you want to run it.

public static final String HighPrioQueue = "high-prio";
public static final String DefaultQueue = "default";
public static final String LowPrioQueue = "low-prio";

public void runJobs() {

@Job(queue = HighPrioQueue)
public void startJobOnHighPrioQueue() {
    System.out.println("This job will bypass all other enqueued jobs.");

@Job(queue = DefaultQueue)
public void startJobOnDefaultQueue() {
    System.out.println("This job will only bypass jobs on the LowPrioQueue");

@Job(queue = LowPrioQueue)
public void startJobOnLowPrioQueue() {
    System.out.println("This job will only start when all other jobs on the HighPrioQueue and DefaultQueue are finished.");


Configuration is easy, both in the fluent api and using Spring configuration:

Fluent Api

Using the fluent API, first specify all the queues as Strings (or string constants) and then continue the configuration as normal.

    .useQueues(DefaultQueue, HighPrioQueue, DefaultQueue, LowPrioQueue)
When configuring queues, specify the default queue for all jobs first and then specify all the queues, going from highest priority to lowest priority. Using constants keeps the code readable.

Spring configuration

For the Spring configuration, just define an extra bean of type Queues and pass it to the JobRunrDashboardWebServer and the JobScheduler.

    public Queues queues() {
        return new Queues(defaultQueue, queues);

    public JobRunrDashboardWebServer dashboardWebServer(StorageProvider storageProvider, JsonMapper jsonMapper, Queues queues) {
        final JobRunrDashboardWebServer jobRunrDashboardWebServer = new JobRunrDashboardWebServer(storageProvider, jsonMapper, queues);
        return jobRunrDashboardWebServer;

    public JobScheduler jobScheduler(StorageProvider storageProvider, Queues queues) {
        JobScheduler jobScheduler = new JobScheduler(storageProvider, queues);
        return jobScheduler;
Create a Queues bean with the different queues and pass it to the JobRunrDashboardWebServer and the JobScheduler


The Pro version of JobRunr comes with an enhanced dashboard that shows you the different queues.

Thanks to queues, we have an overview how many jobs are enqueued on the high-prio queue, standard queue and low-prio queue