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 aKafkaConsumerBackoffManager
instance with or without aKafkaConsumerTimingAdjuster
.- Since:
- 2.7
- Author:
- Tomaz Fernandes
-
-
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 theKafkaConsumerBackoffManager
with the providedClock
.PartitionPausingBackOffManagerFactory(org.springframework.core.task.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected KafkaConsumerBackoffManager
doCreateManager(ListenerContainerRegistry registry)
protected java.time.Clock
getDefaultClock()
void
setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
Sets theTaskExecutor
that will be used in theKafkaConsumerTimingAdjuster
.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.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 Detail
-
PartitionPausingBackOffManagerFactory
public PartitionPausingBackOffManagerFactory(KafkaConsumerTimingAdjuster timingAdjustmentManager)
Constructs a factory instance that will create theKafkaConsumerBackoffManager
instances with the providedKafkaConsumerTimingAdjuster
.- Parameters:
timingAdjustmentManager
- theKafkaConsumerTimingAdjuster
to be used.
-
PartitionPausingBackOffManagerFactory
public PartitionPausingBackOffManagerFactory(org.springframework.core.task.TaskExecutor timingAdjustmentManagerTaskExecutor)
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
public PartitionPausingBackOffManagerFactory(ListenerContainerRegistry listenerContainerRegistry)
Constructs a factory instance using the providedListenerContainerRegistry
.- Parameters:
listenerContainerRegistry
- theListenerContainerRegistry
to 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 theKafkaConsumerBackoffManager
with 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 theWakingKafkaConsumerTimingAdjuster
that 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 theTaskExecutor
that will be used in theKafkaConsumerTimingAdjuster
.- Parameters:
taskExecutor
- the taskExecutor to be used.
-
doCreateManager
protected KafkaConsumerBackoffManager doCreateManager(ListenerContainerRegistry registry)
- Specified by:
doCreateManager
in classAbstractKafkaBackOffManagerFactory
-
getDefaultClock
protected final java.time.Clock getDefaultClock()
-
-