public class StatefulRetryOperationsInterceptorFactoryBean extends AbstractRetryOperationsInterceptorFactoryBean
RetryTemplate
. Stateful retry is appropriate
if your listener is using a transactional resource that needs to be rollback on an exception (e.g. a stateful
connection to a back end server). JPA is the canonical example. The semantics of stateful retry mean that a listener
exception is propagated to the container, so that it can force a rollback. When the message is redelivered it has to
be recognised (hence the MessageKeyGenerator
strategy), and when the retry attempts are exhausted it will be
processed using a MessageRecoverer
if one is provided, in a new transaction. If a recoverer is not provided
the message will be logged and dropped.RetryOperations.execute(org.springframework.retry.RetryCallback, org.springframework.retry.RecoveryCallback,
org.springframework.retry.RetryState)
OBJECT_TYPE_ATTRIBUTE
Constructor and Description |
---|
StatefulRetryOperationsInterceptorFactoryBean() |
Modifier and Type | Method and Description |
---|---|
org.springframework.retry.interceptor.StatefulRetryOperationsInterceptor |
getObject() |
Class<?> |
getObjectType() |
boolean |
isSingleton() |
void |
setMessageKeyGenerator(MessageKeyGenerator messageKeyGeneretor) |
void |
setNewMessageIdentifier(NewMessageIdentifier newMessageIdentifier) |
getMessageRecoverer, getRetryOperations, setMessageRecoverer, setRetryOperations
public StatefulRetryOperationsInterceptorFactoryBean()
public void setMessageKeyGenerator(MessageKeyGenerator messageKeyGeneretor)
public void setNewMessageIdentifier(NewMessageIdentifier newMessageIdentifier)
public org.springframework.retry.interceptor.StatefulRetryOperationsInterceptor getObject()
public Class<?> getObjectType()
public boolean isSingleton()
isSingleton
in interface FactoryBean<Advice>
isSingleton
in class AbstractRetryOperationsInterceptorFactoryBean