Step 5 of 21
·
4 minutes
Automatic Retries
The Scenario
PDF generation occasionally fails due to network timeouts, memory pressure,
or temporary service unavailability. These transient failures are a fact of life
in distributed systems.
Without automatic retries, you'd need to track failures and manually requeue them.
The Challenge
How do we handle transient failures without losing jobs or requiring manual intervention?
The Solution
JobRunr automatically retries failed jobs with exponential backoff!
By default, a failed job is retried up to 10 times with increasing delays:
3s → 9s → 27s → 1m21s → 4m3s → ...
This gives transient issues time to resolve while not overwhelming the system.
You can customize the amount of retries per Job with @Job(retries = 5).
More configuration options are available in the docs!
Read the documentation →
Try It Yourself
Trigger the bulk expense summary report generation. Watch some jobs fail (the code randomly
throws exceptions!) and then automatically retry until they succeed.
You need to log in to perform write operations. You can still view the code solution and dashboard.