Uses of Class
org.springframework.retry.support.RetryTemplateBuilder
Packages that use RetryTemplateBuilder
Package
Description
Infrastructure implementations of retry support concerns.
-
Uses of RetryTemplateBuilder in org.springframework.retry.support
Methods in org.springframework.retry.support that return RetryTemplateBuilderModifier and TypeMethodDescriptionstatic RetryTemplateBuilderRetryTemplate.builder()Main entry point to configure RetryTemplate using fluent API.RetryTemplateBuilder.customBackoff(BackOffPolicy backOffPolicy) You can provide your ownBackOffPolicyvia this method.RetryTemplateBuilder.customPolicy(RetryPolicy policy) If flexibility of this builder is not enough for you, you can provide your ownRetryPolicyvia this method.RetryTemplateBuilder.exponentialBackoff(long initialInterval, double multiplier, long maxInterval) Use exponential backoff policy.RetryTemplateBuilder.exponentialBackoff(long initialInterval, double multiplier, long maxInterval, boolean withRandom) Use exponential backoff policy.RetryTemplateBuilder.fixedBackoff(long interval) Perform each retry after fixed amount of time.RetryTemplateBuilder.infiniteRetry()Allows infinite retry, do not limit attempts by number or time.RetryTemplateBuilder.maxAttempts(int maxAttempts) Limits maximum number of attempts to provided value.RetryTemplateBuilder.noBackoff()Do not pause between attempts, retry immediately.RetryTemplateBuilder.notRetryOn(Class<? extends Throwable> throwable) Add a throwable to the black list of retryable exceptions.RetryTemplateBuilder.notRetryOn(List<Class<? extends Throwable>> throwables) Add all throwables to the black list of retryable exceptions.Add a throwable to the while list of retryable exceptions.Add all throwables to the while list of retryable exceptions.RetryTemplateBuilder.traversingCauses()Suppose throwing anew MyLogicException(new IOException()).RetryTemplateBuilder.uniformRandomBackoff(long minInterval, long maxInterval) UseUniformRandomBackOffPolicy, see it's doc for details.RetryTemplateBuilder.withinMillis(long timeout) Allows retry if there is no more thantimeoutmillis since first attempt.RetryTemplateBuilder.withListener(RetryListener listener) Appends providedlistenertoRetryTemplate's listener list.RetryTemplateBuilder.withListeners(List<RetryListener> listeners) Appends all providedlistenerstoRetryTemplate's listener list.