RetryPolicy
to set
retry properties. The developer could implement their own logic in the connector
itself for the retry, though it's not recommended to do so.
Example of retrying from connector by emitting errors:
e.g. fetchContext
.newError("2", "error-retry-test-2")
.retryPolicy(r -> {
r.setMaxRetries(5);
r.setDelayInSeconds(10);
})
.metadata(m -> {
m.merge(fetchContext.getFetchInput().getMetadata());
})
}
@Deprecated
public interface Retryer
Modifier and Type | Method and Description |
---|---|
<T> T |
get(java.util.concurrent.Callable<T> callable)
Deprecated.
Executes a
Callable with the context of the retry. |
void |
run(CheckedRunnable runnable)
Deprecated.
Executes a
CheckedRunnable with the context of the retry. |
<T> Retryer |
withRetryIf(java.util.function.Predicate<T> predicate)
Deprecated.
Optional predicates to be compared against the result of the "get" result of a retry.
|
Retryer |
withRetryOn(java.util.function.Predicate<java.lang.Throwable> throwablePredicate)
Deprecated.
Optional predicates to be evaluated before the retryer implementation runs a retry
|
<T> T get(java.util.concurrent.Callable<T> callable)
Callable
with the context of the retry. If the callable throws any exception, then the retryer
will handle that according with the configuration the retryer was created.T
- type returned by provided Callable
callable
- Callable
to be executedvoid run(CheckedRunnable runnable)
CheckedRunnable
with the context of the retry. If the CheckedRunnable
throws any
exception, then the
retryer will handle that according with the configuration the retryer was created.runnable
- CheckedRunnable
to be executedRetryer withRetryOn(java.util.function.Predicate<java.lang.Throwable> throwablePredicate)
throwablePredicate
- Predicate to verify against the exceptions thrown on the retry.<T> Retryer withRetryIf(java.util.function.Predicate<T> predicate)
T
- type accepted by predicatepredicate
- Predicate to verify against the result of the retry.