Class AbstractKafkaBackOffManagerFactory
- java.lang.Object
-
- org.springframework.kafka.listener.AbstractKafkaBackOffManagerFactory
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
,KafkaBackOffManagerFactory
- Direct Known Subclasses:
PartitionPausingBackOffManagerFactory
public abstract class AbstractKafkaBackOffManagerFactory extends java.lang.Object implements KafkaBackOffManagerFactory, org.springframework.context.ApplicationContextAware
Base class forKafkaBackOffManagerFactory
implementations.- Since:
- 2.7
- See Also:
KafkaConsumerBackoffManager
-
-
Constructor Summary
Constructors Constructor Description AbstractKafkaBackOffManagerFactory()
Creates an instance that will retrieve theListenerContainerRegistry
from theApplicationContext
.AbstractKafkaBackOffManagerFactory(ListenerContainerRegistry listenerContainerRegistry)
Creates an instance with the providedListenerContainerRegistry
, which will be used to fetch theMessageListenerContainer
to back off.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addApplicationListener(org.springframework.context.ApplicationListener<?> applicationListener)
KafkaConsumerBackoffManager
create()
protected abstract KafkaConsumerBackoffManager
doCreateManager(ListenerContainerRegistry registry)
protected <T> T
getBean(java.lang.String beanName, java.lang.Class<T> beanClass)
protected ListenerContainerRegistry
getListenerContainerRegistry()
void
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
void
setListenerContainerRegistry(ListenerContainerRegistry listenerContainerRegistry)
Sets theListenerContainerRegistry
, that will be used to fetch theMessageListenerContainer
to back off.
-
-
-
Constructor Detail
-
AbstractKafkaBackOffManagerFactory
public AbstractKafkaBackOffManagerFactory(ListenerContainerRegistry listenerContainerRegistry)
Creates an instance with the providedListenerContainerRegistry
, which will be used to fetch theMessageListenerContainer
to back off.- Parameters:
listenerContainerRegistry
- the listenerContainerRegistry to use.
-
AbstractKafkaBackOffManagerFactory
public AbstractKafkaBackOffManagerFactory()
Creates an instance that will retrieve theListenerContainerRegistry
from theApplicationContext
.
-
-
Method Detail
-
setListenerContainerRegistry
public void setListenerContainerRegistry(ListenerContainerRegistry listenerContainerRegistry)
Sets theListenerContainerRegistry
, that will be used to fetch theMessageListenerContainer
to back off.- Parameters:
listenerContainerRegistry
- the listenerContainerRegistry to use.
-
create
public KafkaConsumerBackoffManager create()
- Specified by:
create
in interfaceKafkaBackOffManagerFactory
-
doCreateManager
protected abstract KafkaConsumerBackoffManager doCreateManager(ListenerContainerRegistry registry)
-
getListenerContainerRegistry
protected ListenerContainerRegistry getListenerContainerRegistry()
-
getBean
protected <T> T getBean(java.lang.String beanName, java.lang.Class<T> beanClass)
-
addApplicationListener
protected void addApplicationListener(org.springframework.context.ApplicationListener<?> applicationListener)
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
- Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
-
-