Class ResubmissionOptions

java.lang.Object
org.springframework.modulith.events.ResubmissionOptions

public class ResubmissionOptions extends Object
Options to be considered during EventPublication re-submission.
Since:
2.0
Author:
Oliver Drotbohm
  • Method Details

    • defaults

      public static ResubmissionOptions defaults()
      Creates a new ResubmissionOptions with no bound for in-flight publications, a batch size of 100, no minimum age and including all EventPublication instances.
      Returns:
      will never be null.
    • getMaxInFlight

      public int getMaxInFlight()
    • withMaxInFlight

      public ResubmissionOptions withMaxInFlight(int maxInFlight)
      Configures the number of publications that are supposed to be in flight concurrently. This means that for each re-submission attempt, only a number less than or equal to the configured value will be resubmitted.
      Parameters:
      maxInFlight - must not be less than or equal to zero.
      Returns:
      will never be null.
    • getBatchSize

      public int getBatchSize()
    • withBatchSize

      public ResubmissionOptions withBatchSize(int batchSize)
      Configures the batch size with which to read publications from the database.
      Parameters:
      batchSize - must not be less than or equal to zero.
      Returns:
      will never be null.
    • getMinAge

      public Duration getMinAge()
    • withMinAge

      public ResubmissionOptions withMinAge(Duration minAge)
      Configures the minimum age of event publications to qualify for re-submission.
      Parameters:
      minAge - must not null be negative.
      Returns:
      will never be null.
    • getFilter

      public Predicate<EventPublication> getFilter()
    • withFilter

      public ResubmissionOptions withFilter(Predicate<EventPublication> filter)
      Configures which EventPublications to resubmit in a re-submission attempt.
      Parameters:
      filter - must not be null.
      Returns:
      will never be null.