public interface RetryPolicyTemplate
RetryPolicy instance each time the retry goes into effect, thereby resetting any
state the policy may have (counters, etc.)
A RetryNotifier may be set in order to take action upon each retry attempt.| Modifier and Type | Method and Description |
|---|---|
default <T> org.reactivestreams.Publisher<T> |
applyPolicy(org.reactivestreams.Publisher<T> publisher,
Predicate<Throwable> shouldRetry,
Consumer<Throwable> onExhausted)
Applies the retry policy in a non blocking manner by transforming
the given
publisher into one configured to apply the retry
logic. |
RetryPolicy |
createRetryInstance() |
RetryContext |
execute(RetryCallback callback,
Executor workManager)
Applies the retry policy by performing a blocking action.
|
Map<Object,Object> |
getMetaInfo() |
RetryNotifier |
getNotifier() |
void |
setMetaInfo(Map<Object,Object> metaInfo) |
void |
setNotifier(RetryNotifier retryNotifier) |
RetryPolicy createRetryInstance()
RetryNotifier getNotifier()
void setNotifier(RetryNotifier retryNotifier)
RetryContext execute(RetryCallback callback, Executor workManager) throws Exception
callback - a callback with the logic to be executed on each retryworkManager - the executor on which the retry operations are to be executedRetryContextExceptiondefault <T> org.reactivestreams.Publisher<T> applyPolicy(org.reactivestreams.Publisher<T> publisher,
Predicate<Throwable> shouldRetry,
Consumer<Throwable> onExhausted)
publisher into one configured to apply the retry
logic.T - the generic type of the publisher's contentpublisher - a publisher with the items which might failshouldRetry - a predicate which evaluates each item to know if it should be retried or notonExhausted - an action to perform when the retry action has been exhaustedPublisher configured with the retry policy.Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.