Are you running a multi-tenant application? Or do you have diverse types of jobs where certain types of jobs could potentially trigger peak workloads? Use JobRunr’s built-in dynamic queues to make sure that there is some fair-use and all jobs get a fair amount of resources!
Note: JobRunr Pro supports unlimited dynamic queues and they can be used together with the priority queues.
Example Use Cases
- In a multi-tenant application where each tenant can initiate their own jobs, JobRunr ensures fair-use processing. Regardless of whether one tenant generates millions of jobs, the system guarantees that jobs from other tenants are also duly processed.
- In a diverse workload environment, certain jobs, such as mass mailings, could potentially trigger surges by generating millions of subsidiary child jobs that require processing. However, it’s crucial that other types of jobs remain unaffected by these spikes and continue to be processed smoothly.
JobRunr supports two different types of load-balancing:
- Round Robin Dynamic Queues: here, each dynamic queue receives the same amount of resource usage
- Weighted Round Robin Dynamic Queues: : here, certain dynamic queues can be configured with an optional weight. A queue with a weight of 2 will be checked twice as often as a queue with a weight of 1.
If you’re using this feature, you can also enable an extra Dynamic Queues view in the dashboard. This view gives an immediate overview of the amount of jobs per dynamic queue.
Using dynamic queues is as easy as adding a label to your job!
Round Robin Dynamic Queues
Configuring Round Robin Dynamic Queues by means of the Fluent API:
You can configure your round robin dynamic queues easily by means of the Fluent API:
Configuring Round Robin Dynamic Queues by means of Spring Boot Properties:
You can also enable the round robin dynamic queues easily via Spring properties:
Weighted Round Robin Dynamic Queues
Configuring Weighted Round Robin Dynamic Queues by means of the Fluent API:
You can again easily configure your weighted round robin dynamic queues by means of the Fluent API:
Configuring Weighted Round Robin Dynamic Queues by means of Spring Boot Properties:
You can also enable the weighted round robin dynamic queues easily via Spring Bean:
Using dynamic queues could not have been easier thanks to Job Labels:
If you prefer the
JobBuilder pattern, this is also really easy: