Class PartitionPausingBackOffManagerFactory
- java.lang.Object
-
- org.springframework.kafka.listener.AbstractKafkaBackOffManagerFactory
-
- org.springframework.kafka.listener.PartitionPausingBackOffManagerFactory
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,KafkaBackOffManagerFactory
public class PartitionPausingBackOffManagerFactory extends AbstractKafkaBackOffManagerFactory
Creates aKafkaConsumerBackoffManagerinstance with or without aKafkaConsumerTimingAdjuster.- Since:
- 2.7
-
-
Constructor Summary
Constructors Constructor Description PartitionPausingBackOffManagerFactory()Constructs a factory instance with default dependencies.PartitionPausingBackOffManagerFactory(boolean timingAdjustmentEnabled)Constructs a factory instance specifying whether or not timing adjustment is enabled for this factoriesKafkaConsumerBackoffManager.PartitionPausingBackOffManagerFactory(java.time.Clock clock)Constructs an factory instance that will create theKafkaConsumerBackoffManagerwith the providedClock.PartitionPausingBackOffManagerFactory(org.springframework.core.task.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected KafkaConsumerBackoffManagerdoCreateManager(ListenerContainerRegistry registry)protected java.time.ClockgetDefaultClock()voidsetTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)Sets theTaskExecutorthat will be used in theKafkaConsumerTimingAdjuster.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.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 Detail
-
PartitionPausingBackOffManagerFactory
public PartitionPausingBackOffManagerFactory(KafkaConsumerTimingAdjuster timingAdjustmentManager)
Constructs a factory instance that will create theKafkaConsumerBackoffManagerinstances with the providedKafkaConsumerTimingAdjuster.- Parameters:
timingAdjustmentManager- theKafkaConsumerTimingAdjusterto be used.
-
PartitionPausingBackOffManagerFactory
public PartitionPausingBackOffManagerFactory(org.springframework.core.task.TaskExecutor timingAdjustmentManagerTaskExecutor)
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
public PartitionPausingBackOffManagerFactory(ListenerContainerRegistry listenerContainerRegistry)
Constructs a factory instance using the providedListenerContainerRegistry.- Parameters:
listenerContainerRegistry- theListenerContainerRegistryto be used.
-
PartitionPausingBackOffManagerFactory
public PartitionPausingBackOffManagerFactory()
Constructs a factory instance with default dependencies.
-
PartitionPausingBackOffManagerFactory
public PartitionPausingBackOffManagerFactory(java.time.Clock clock)
Constructs an factory instance that will create theKafkaConsumerBackoffManagerwith the providedClock.- Parameters:
clock- the clock instance to be used.
-
-
Method Detail
-
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
public final void setTimingAdjustmentManager(KafkaConsumerTimingAdjuster timingAdjustmentManager)
Sets theWakingKafkaConsumerTimingAdjusterthat will be used with the resultingKafkaConsumerBackoffManager.- Parameters:
timingAdjustmentManager- the adjustmentManager to be used.
-
setTaskExecutor
public final void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
Sets theTaskExecutorthat will be used in theKafkaConsumerTimingAdjuster.- Parameters:
taskExecutor- the taskExecutor to be used.
-
doCreateManager
protected KafkaConsumerBackoffManager doCreateManager(ListenerContainerRegistry registry)
- Specified by:
doCreateManagerin classAbstractKafkaBackOffManagerFactory
-
getDefaultClock
protected final java.time.Clock getDefaultClock()
-
-