Step 10 of 21
·
4 minutes
VIP Treatment
The Scenario
The job queue has 10,000 monthly statements, but a customer just made
a payment that needs to be processed urgently.
Payments are revenue. Reports can wait. We need a way to prioritize.
The Challenge
How do we ensure critical jobs jump the queue and get processed immediately?
The Solution
Use
Priority Queues to define job importance:
jobScheduler.create(aJob()
.withQueue("High") // You can also use an enum for this
.withDetails(() -> createCreditCard(card)));
// or via the @Job annotation
@Job(queue = "High")
public void processPayment(Payment payment) { ... }
@Job(queue = "Low")
public void generateReport() { ... }
Configure the queues in order of priority. JobRunr always processes higher-priority
queues first.
Read the documentation →
Try It Yourself
- Trigger 1000 expense reports (low priority)
- Make a payment (high priority)
- Watch the payment complete immediately despite the backlog!
You need to log in to perform write operations. You can still view the code solution and dashboard.