Class StreamRetryOperationsInterceptorFactoryBean
- java.lang.Object
-
- org.springframework.amqp.rabbit.config.AbstractRetryOperationsInterceptorFactoryBean
-
- org.springframework.amqp.rabbit.config.StatelessRetryOperationsInterceptorFactoryBean
-
- org.springframework.rabbit.stream.retry.StreamRetryOperationsInterceptorFactoryBean
-
- All Implemented Interfaces:
FactoryBean<Advice>
public class StreamRetryOperationsInterceptorFactoryBean extends StatelessRetryOperationsInterceptorFactoryBean
Convenient factory bean for creating a stateless retry interceptor for use in aStreamListenerContainer
when consuming native stream messages, giving you a large amount of control over the behavior 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 aStreamMessageRecoverer
if one is provided.- Author:
- Gary Russell
- See Also:
RetryOperations.execute(org.springframework.retry.RetryCallback,org.springframework.retry.RecoveryCallback)
-
-
Field Summary
-
Fields inherited from class org.springframework.amqp.rabbit.config.StatelessRetryOperationsInterceptorFactoryBean
logger
-
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
-
Constructor Summary
Constructors Constructor Description StreamRetryOperationsInterceptorFactoryBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.springframework.retry.interceptor.MethodInvocationRecoverer<?>
createRecoverer()
void
setMessageRecoverer(MessageRecoverer messageRecoverer)
void
setStreamMessageRecoverer(StreamMessageRecoverer messageRecoverer)
Set aStreamMessageRecoverer
to call when retries are exhausted.-
Methods inherited from class org.springframework.amqp.rabbit.config.StatelessRetryOperationsInterceptorFactoryBean
getObject, getObjectType, isSingleton, recover
-
Methods inherited from class org.springframework.amqp.rabbit.config.AbstractRetryOperationsInterceptorFactoryBean
getMessageRecoverer, getRetryOperations, setRetryOperations
-
-
-
-
Method Detail
-
createRecoverer
protected org.springframework.retry.interceptor.MethodInvocationRecoverer<?> createRecoverer()
- Overrides:
createRecoverer
in classStatelessRetryOperationsInterceptorFactoryBean
-
setStreamMessageRecoverer
public void setStreamMessageRecoverer(StreamMessageRecoverer messageRecoverer)
Set aStreamMessageRecoverer
to call when retries are exhausted.- Parameters:
messageRecoverer
- the recoverer.
-
setMessageRecoverer
public void setMessageRecoverer(MessageRecoverer messageRecoverer)
- Overrides:
setMessageRecoverer
in classAbstractRetryOperationsInterceptorFactoryBean
-
-