Class ResubmissionOptions
java.lang.Object
org.springframework.modulith.events.ResubmissionOptions
Options to be considered during
EventPublication re-submission.- Since:
- 2.0
- Author:
- Oliver Drotbohm
-
Method Summary
Modifier and TypeMethodDescriptionstatic ResubmissionOptionsdefaults()Creates a newResubmissionOptionswith no bound for in-flight publications, a batch size of 100, no minimum age and including allEventPublicationinstances.intintwithBatchSize(int batchSize) Configures the batch size with which to read publications from the database.withFilter(Predicate<EventPublication> filter) Configures whichEventPublications to resubmit in a re-submission attempt.withMaxInFlight(int maxInFlight) Configures the number of publications that are supposed to be in flight concurrently.withMinAge(Duration minAge) Configures the minimum age of event publications to qualify for re-submission.
-
Method Details
-
defaults
Creates a newResubmissionOptionswith no bound for in-flight publications, a batch size of 100, no minimum age and including allEventPublicationinstances.- Returns:
- will never be null.
-
getMaxInFlight
public int getMaxInFlight() -
withMaxInFlight
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
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
-
withMinAge
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
-
withFilter
Configures whichEventPublications to resubmit in a re-submission attempt.- Parameters:
filter- must not be null.- Returns:
- will never be null.
-