Class AbstractRetryingMessageListenerAdapter<K,V,T>
java.lang.Object
org.springframework.kafka.listener.adapter.AbstractDelegatingMessageListenerAdapter<T>
org.springframework.kafka.listener.adapter.AbstractRetryingMessageListenerAdapter<K,V,T>
- Type Parameters:
K
- the key type.V
- the value type.T
- the delegate type.
- All Implemented Interfaces:
ConsumerSeekAware
,DelegatingMessageListener<T>
public abstract class AbstractRetryingMessageListenerAdapter<K,V,T>
extends AbstractDelegatingMessageListenerAdapter<T>
Base class for retrying message listener adapters.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.kafka.listener.ConsumerSeekAware
ConsumerSeekAware.ConsumerSeekCallback
-
Field Summary
Fields inherited from class org.springframework.kafka.listener.adapter.AbstractDelegatingMessageListenerAdapter
delegate, delegateType, logger
-
Constructor Summary
ConstructorDescriptionAbstractRetryingMessageListenerAdapter
(T delegate, org.springframework.retry.support.RetryTemplate retryTemplate) Construct an instance with the supplied retry template.AbstractRetryingMessageListenerAdapter
(T delegate, org.springframework.retry.support.RetryTemplate retryTemplate, org.springframework.retry.RecoveryCallback<? extends Object> recoveryCallback) Construct an instance with the supplied template and callback. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.retry.RecoveryCallback<? extends Object>
org.springframework.retry.support.RetryTemplate
Methods inherited from class org.springframework.kafka.listener.adapter.AbstractDelegatingMessageListenerAdapter
getDelegate, onIdleContainer, onPartitionsAssigned, onPartitionsRevoked, registerSeekCallback
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.kafka.listener.ConsumerSeekAware
onFirstPoll, unregisterSeekCallback
-
Constructor Details
-
AbstractRetryingMessageListenerAdapter
public AbstractRetryingMessageListenerAdapter(T delegate, org.springframework.retry.support.RetryTemplate retryTemplate) Construct an instance with the supplied retry template. The exception will be thrown to the container after retries are exhausted.- Parameters:
delegate
- the delegate listener.retryTemplate
- the template.
-
AbstractRetryingMessageListenerAdapter
public AbstractRetryingMessageListenerAdapter(T delegate, org.springframework.retry.support.RetryTemplate retryTemplate, @Nullable org.springframework.retry.RecoveryCallback<? extends Object> recoveryCallback) Construct an instance with the supplied template and callback.- Parameters:
delegate
- the delegate listener.retryTemplate
- the template.recoveryCallback
- the recovery callback; if null, the exception will be thrown to the container after retries are exhausted.
-
-
Method Details
-
getRetryTemplate
public org.springframework.retry.support.RetryTemplate getRetryTemplate() -
getRecoveryCallback
-