Class PartitionPausingBackOffManagerFactory
java.lang.Object
org.springframework.kafka.listener.AbstractKafkaBackOffManagerFactory
org.springframework.kafka.listener.PartitionPausingBackOffManagerFactory
- All Implemented Interfaces:
Aware,ApplicationContextAware,KafkaBackOffManagerFactory
Creates a
KafkaConsumerBackoffManager instance
with or without a KafkaConsumerTimingAdjuster.- Since:
- 2.7
- Author:
- Tomaz Fernandes
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a factory instance with default dependencies.PartitionPausingBackOffManagerFactory(boolean timingAdjustmentEnabled) Constructs a factory instance specifying whether or not timing adjustment is enabled for this factoriesKafkaConsumerBackoffManager.Constructs an factory instance that will create theKafkaConsumerBackoffManagerwith the providedClock.PartitionPausingBackOffManagerFactory(TaskExecutor timingAdjustmentManagerTaskExecutor) Constructs a factory instance that will create theKafkaConsumerBackoffManagerinstances with the providedTaskExecutorin itsKafkaConsumerTimingAdjuster.PartitionPausingBackOffManagerFactory(KafkaConsumerTimingAdjuster timingAdjustmentManager) Constructs a factory instance that will create theKafkaConsumerBackoffManagerinstances with the providedKafkaConsumerTimingAdjuster.PartitionPausingBackOffManagerFactory(ListenerContainerRegistry listenerContainerRegistry) Constructs a factory instance using the providedListenerContainerRegistry. -
Method Summary
Modifier and TypeMethodDescriptionprotected KafkaConsumerBackoffManagerdoCreateManager(ListenerContainerRegistry registry) protected final Clockfinal voidsetTaskExecutor(TaskExecutor taskExecutor) Sets theTaskExecutorthat will be used in theKafkaConsumerTimingAdjuster.final voidsetTimingAdjustmentEnabled(boolean timingAdjustmentEnabled) Set this property to false if you don't want the resulting KafkaBackOffManager to adjust the precision of the topics' consumption timing.final voidsetTimingAdjustmentManager(KafkaConsumerTimingAdjuster timingAdjustmentManager) Sets theWakingKafkaConsumerTimingAdjusterthat will be used with the resultingKafkaConsumerBackoffManager.Methods inherited from class org.springframework.kafka.listener.AbstractKafkaBackOffManagerFactory
addApplicationListener, create, getBean, getListenerContainerRegistry, setApplicationContext, setListenerContainerRegistry
-
Constructor Details
-
PartitionPausingBackOffManagerFactory
Constructs a factory instance that will create theKafkaConsumerBackoffManagerinstances with the providedKafkaConsumerTimingAdjuster.- Parameters:
timingAdjustmentManager- theKafkaConsumerTimingAdjusterto be used.
-
PartitionPausingBackOffManagerFactory
Constructs a factory instance that will create theKafkaConsumerBackoffManagerinstances with the providedTaskExecutorin itsKafkaConsumerTimingAdjuster.- Parameters:
timingAdjustmentManagerTaskExecutor- theTaskExecutorto be used.
-
PartitionPausingBackOffManagerFactory
public PartitionPausingBackOffManagerFactory(boolean timingAdjustmentEnabled) Constructs a factory instance specifying whether or not timing adjustment is enabled for this factoriesKafkaConsumerBackoffManager.- Parameters:
timingAdjustmentEnabled- theKafkaConsumerTimingAdjusterto be used.
-
PartitionPausingBackOffManagerFactory
Constructs a factory instance using the providedListenerContainerRegistry.- Parameters:
listenerContainerRegistry- theListenerContainerRegistryto be used.
-
PartitionPausingBackOffManagerFactory
public PartitionPausingBackOffManagerFactory()Constructs a factory instance with default dependencies. -
PartitionPausingBackOffManagerFactory
Constructs an factory instance that will create theKafkaConsumerBackoffManagerwith the providedClock.- Parameters:
clock- the clock instance to be used.
-
-
Method Details
-
setTimingAdjustmentEnabled
public final void setTimingAdjustmentEnabled(boolean timingAdjustmentEnabled) Set this property to false if you don't want the resulting KafkaBackOffManager to adjust the precision of the topics' consumption timing.- Parameters:
timingAdjustmentEnabled- set to false to disable timing adjustment.
-
setTimingAdjustmentManager
Sets theWakingKafkaConsumerTimingAdjusterthat will be used with the resultingKafkaConsumerBackoffManager.- Parameters:
timingAdjustmentManager- the adjustmentManager to be used.
-
setTaskExecutor
Sets theTaskExecutorthat will be used in theKafkaConsumerTimingAdjuster.- Parameters:
taskExecutor- the taskExecutor to be used.
-
doCreateManager
- Specified by:
doCreateManagerin classAbstractKafkaBackOffManagerFactory
-
getDefaultClock
-