Class StatelessRetryOperationsInterceptorFactoryBean
- java.lang.Object
-
- org.springframework.amqp.rabbit.config.AbstractRetryOperationsInterceptorFactoryBean
-
- org.springframework.amqp.rabbit.config.StatelessRetryOperationsInterceptorFactoryBean
-
- All Implemented Interfaces:
FactoryBean<Advice>
- Direct Known Subclasses:
StreamRetryOperationsInterceptorFactoryBean
public class StatelessRetryOperationsInterceptorFactoryBean extends AbstractRetryOperationsInterceptorFactoryBean
Convenient factory bean for creating a stateless retry interceptor for use in a message listener container, giving you a large amount of control over the behaviour of a container when a listener fails. To control the number of retry attempt or the backoff in between attempts, supply a customizedRetryTemplate
. Stateless retry is appropriate if your listener can be called repeatedly between failures with no side effects. The semantics of stateless retry mean that a listener exception is not propagated to the container until the retry attempts are exhausted. When the retry attempts are exhausted it can be processed using aMessageRecoverer
if one is provided, in the same transaction (in which case no exception is propagated). If a recoverer is not provided the exception will be propagated and the message may be redelivered if the channel is transactional.- Author:
- Dave Syer, Gary Russell
- See Also:
RetryOperations.execute(org.springframework.retry.RetryCallback, org.springframework.retry.RecoveryCallback)
-
-
Field Summary
Fields Modifier and Type Field Description protected Log
logger
-
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
-
Constructor Summary
Constructors Constructor Description StatelessRetryOperationsInterceptorFactoryBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.springframework.retry.interceptor.MethodInvocationRecoverer<?>
createRecoverer()
org.springframework.retry.interceptor.RetryOperationsInterceptor
getObject()
java.lang.Class<?>
getObjectType()
boolean
isSingleton()
protected java.lang.Object
recover(java.lang.Object[] args, java.lang.Throwable cause)
-
Methods inherited from class org.springframework.amqp.rabbit.config.AbstractRetryOperationsInterceptorFactoryBean
getMessageRecoverer, getRetryOperations, setMessageRecoverer, setRetryOperations
-
-
-
-
Field Detail
-
logger
protected final Log logger
-
-
Method Detail
-
getObject
public org.springframework.retry.interceptor.RetryOperationsInterceptor getObject()
-
createRecoverer
protected org.springframework.retry.interceptor.MethodInvocationRecoverer<?> createRecoverer()
-
recover
protected java.lang.Object recover(java.lang.Object[] args, java.lang.Throwable cause)
-
getObjectType
public java.lang.Class<?> getObjectType()
-
isSingleton
public boolean isSingleton()
- Specified by:
isSingleton
in interfaceFactoryBean<Advice>
- Overrides:
isSingleton
in classAbstractRetryOperationsInterceptorFactoryBean
-
-