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 theKafkaConsumerBackoffManager
with the providedClock
.PartitionPausingBackOffManagerFactory
(TaskExecutor timingAdjustmentManagerTaskExecutor) Constructs a factory instance that will create theKafkaConsumerBackoffManager
instances with the providedTaskExecutor
in itsKafkaConsumerTimingAdjuster
.PartitionPausingBackOffManagerFactory
(KafkaConsumerTimingAdjuster timingAdjustmentManager) Constructs a factory instance that will create theKafkaConsumerBackoffManager
instances with the providedKafkaConsumerTimingAdjuster
.PartitionPausingBackOffManagerFactory
(ListenerContainerRegistry listenerContainerRegistry) Constructs a factory instance using the providedListenerContainerRegistry
. -
Method Summary
Modifier and TypeMethodDescriptionprotected KafkaConsumerBackoffManager
doCreateManager
(ListenerContainerRegistry registry) protected final Clock
final void
setTaskExecutor
(TaskExecutor taskExecutor) Sets theTaskExecutor
that will be used in theKafkaConsumerTimingAdjuster
.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.final void
setTimingAdjustmentManager
(KafkaConsumerTimingAdjuster timingAdjustmentManager) Sets theWakingKafkaConsumerTimingAdjuster
that 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 theKafkaConsumerBackoffManager
instances with the providedKafkaConsumerTimingAdjuster
.- Parameters:
timingAdjustmentManager
- theKafkaConsumerTimingAdjuster
to be used.
-
PartitionPausingBackOffManagerFactory
Constructs a factory instance that will create theKafkaConsumerBackoffManager
instances with the providedTaskExecutor
in itsKafkaConsumerTimingAdjuster
.- Parameters:
timingAdjustmentManagerTaskExecutor
- theTaskExecutor
to be used.
-
PartitionPausingBackOffManagerFactory
public PartitionPausingBackOffManagerFactory(boolean timingAdjustmentEnabled) Constructs a factory instance specifying whether or not timing adjustment is enabled for this factoriesKafkaConsumerBackoffManager
.- Parameters:
timingAdjustmentEnabled
- theKafkaConsumerTimingAdjuster
to be used.
-
PartitionPausingBackOffManagerFactory
Constructs a factory instance using the providedListenerContainerRegistry
.- Parameters:
listenerContainerRegistry
- theListenerContainerRegistry
to be used.
-
PartitionPausingBackOffManagerFactory
public PartitionPausingBackOffManagerFactory()Constructs a factory instance with default dependencies. -
PartitionPausingBackOffManagerFactory
Constructs an factory instance that will create theKafkaConsumerBackoffManager
with 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 theWakingKafkaConsumerTimingAdjuster
that will be used with the resultingKafkaConsumerBackoffManager
.- Parameters:
timingAdjustmentManager
- the adjustmentManager to be used.
-
setTaskExecutor
Sets theTaskExecutor
that will be used in theKafkaConsumerTimingAdjuster
.- Parameters:
taskExecutor
- the taskExecutor to be used.
-
doCreateManager
- Specified by:
doCreateManager
in classAbstractKafkaBackOffManagerFactory
-
getDefaultClock
-