Class RetryFilter

  • All Implemented Interfaces:
    ElectStateFilter, JobFilter

    public class RetryFilter
    extends java.lang.Object
    implements ElectStateFilter
    A JobFilter of type ElectStateFilter that will retry the job if it fails for up to 10 times. This JobFilter is added by default in JobRunr.

    If you want to configure the amount of retries, create a new instance and pass it to the JobRunrConfiguration, e.g.:

         JobRunr.configure()
                     ...
                     .withJobFilter(new RetryFilter(20)) // this will result in 20 retries
                     ...
                     .initialize();
     
    • Field Detail

    • Constructor Detail

      • RetryFilter

        public RetryFilter()
      • RetryFilter

        public RetryFilter​(int numberOfRetries)
    • Method Detail

      • getSecondsToAdd

        protected long getSecondsToAdd​(Job job)
      • getExponentialBackoffPolicy

        protected long getExponentialBackoffPolicy​(Job job,
                                                   int seed)