Class DefaultRetryInterceptor
java.lang.Object
io.micronaut.retry.intercept.DefaultRetryInterceptor
- All Implemented Interfaces:
io.micronaut.aop.Interceptor<Object,Object>, io.micronaut.aop.MethodInterceptor<Object, Object>, io.micronaut.core.order.Ordered
-
Field Summary
Fields inherited from interface io.micronaut.aop.Interceptor
ARGUMENT, CACHEABLE_LAZY_TARGET, HOTSWAP, LAZY, PROXY_TARGETFields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionDefaultRetryInterceptor(io.micronaut.core.convert.ConversionService conversionService, @Nullable io.micronaut.context.event.ApplicationEventPublisher eventPublisher, ExecutorService executorService) Construct a default retry method interceptor with the event publisher. -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.aop.MethodInterceptor
intercept
-
Constructor Details
-
DefaultRetryInterceptor
public DefaultRetryInterceptor(io.micronaut.core.convert.ConversionService conversionService, @Nullable io.micronaut.context.event.ApplicationEventPublisher eventPublisher, @Named("scheduled") ExecutorService executorService) Construct a default retry method interceptor with the event publisher.- Parameters:
conversionService- The conversion serviceeventPublisher- The event publisher to publish retry eventsexecutorService- The executor service to use for completable futures
-
-
Method Details
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceio.micronaut.core.order.Ordered
-
intercept
-
sleep
Performs the sleep between retries and can be overridden to customize sleep behavior.- Parameters:
delayMillis- The delay in milliseconds- Throws:
InterruptedException- If the thread is interrupted during sleep
-