Class RequestHandlerRetryAdvice
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.advice.AbstractRequestHandlerAdvice
org.springframework.integration.handler.advice.RequestHandlerRetryAdvice
- All Implemented Interfaces:
- Advice,- Interceptor,- MethodInterceptor,- Aware,- BeanFactoryAware,- BeanNameAware,- InitializingBean,- ApplicationContextAware,- ExpressionCapable,- NamedComponent
Uses spring-retry to perform stateless or stateful retry.
 Stateless retry means the retries are performed internally
 by the 
RetryTemplate; stateful retry means the
 exception is thrown but state is maintained to support
 the retry policies. Stateful retry requires a
 RetryStateGenerator.- Since:
- 2.2
- Author:
- Gary Russell, Artem Bilan
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.integration.handler.advice.AbstractRequestHandlerAdviceAbstractRequestHandlerAdvice.ExecutionCallback, AbstractRequestHandlerAdvice.ThrowableHolderException
- 
Field SummaryFields inherited from class org.springframework.integration.context.IntegrationObjectSupportEXPRESSION_PARSER, logger
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected ObjectdoInvoke(AbstractRequestHandlerAdvice.ExecutionCallback callback, Object target, Message<?> message) Subclasses implement this method to apply behavior to theMessageHandler.protected voidonInit()Subclasses may implement this for initialization logic.voidsetRecoveryCallback(org.springframework.retry.RecoveryCallback<Object> recoveryCallback) voidsetRetryStateGenerator(RetryStateGenerator retryStateGenerator) voidsetRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate) Set the retry template.Methods inherited from class org.springframework.integration.handler.advice.AbstractRequestHandlerAdviceinvoke, unwrapExceptionIfNecessary, unwrapThrowableIfNecessaryMethods inherited from class org.springframework.integration.context.IntegrationObjectSupportafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getComponentType, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
- 
Constructor Details- 
RequestHandlerRetryAdvicepublic RequestHandlerRetryAdvice()
 
- 
- 
Method Details- 
setRetryTemplatepublic void setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate) Set the retry template. Cause traversal should be enabled in the retry policy because user exceptions may be wrapped in aMessagingException.- Parameters:
- retryTemplate- the retry template.
 
- 
setRecoveryCallbackpublic void setRecoveryCallback(org.springframework.retry.RecoveryCallback<Object> recoveryCallback) 
- 
setRetryStateGenerator
- 
onInitprotected void onInit()Description copied from class:IntegrationObjectSupportSubclasses may implement this for initialization logic.- Overrides:
- onInitin class- IntegrationObjectSupport
 
- 
doInvokeprotected Object doInvoke(AbstractRequestHandlerAdvice.ExecutionCallback callback, Object target, Message<?> message) Description copied from class:AbstractRequestHandlerAdviceSubclasses implement this method to apply behavior to theMessageHandler.callback.execute() invokes the handler method and returns its result, or null. - Specified by:
- doInvokein class- AbstractRequestHandlerAdvice
- Parameters:
- callback- Subclasses invoke the execute() method on this interface to invoke the handler method.
- target- The target handler.
- message- The message that will be sent to the handler.
- Returns:
- the result after invoking the MessageHandler.
 
 
-