Package com.sdl.delivery.retry
Class ConsumerRetryBlock<P,E extends Throwable>
java.lang.Object
com.sdl.delivery.retry.AbstractRetryBlock<P,E>
com.sdl.delivery.retry.ConsumerRetryBlock<P,E>
- Type Parameters:
P- parameter typeE- exception type
Used to perform retries. Based on
Consumer.-
Constructor Summary
ConstructorsConstructorDescriptionConsumerRetryBlock(ThrowableConsumer<P, E> consumer, Supplier<P> propertyProvider) Creates RetryBlock object.ConsumerRetryBlock(ThrowableConsumer<P, E> consumer, Supplier<P> propertyProvider, int maxRetryCount, int attemptDelayFactor) Creates RetryBlock object. -
Method Summary
Methods inherited from class com.sdl.delivery.retry.AbstractRetryBlock
getAttempt, getMaxRetryCount, getPropertyProvider, incrementAttempt, retryIfNecessary
-
Constructor Details
-
ConsumerRetryBlock
Creates RetryBlock object. Note: The real execution is done within execute(). So thepropertyProvideris not called, unlessexecute()is called. The property will be re-evaluated for each attempt.- Parameters:
consumer- consumer, which should be executed.propertyProvider-Supplierfor request property.
-
ConsumerRetryBlock
public ConsumerRetryBlock(ThrowableConsumer<P, E> consumer, Supplier<P> propertyProvider, int maxRetryCount, int attemptDelayFactor) Creates RetryBlock object. Note: The real execution is done within execute(). So thepropertyProvideris not called, unlessexecute()is called. The property will be re-evaluated for each attempt.- Parameters:
consumer- consumer, which should be executed.propertyProvider-Supplierfor request property.maxRetryCount- max retry countattemptDelayFactor- attempt delay factor, used to scale thread sleep time between retries
-
-
Method Details