Class ContainerStoppingBatchErrorHandler
- java.lang.Object
-
- org.springframework.kafka.listener.KafkaExceptionLogLevelAware
-
- org.springframework.kafka.listener.ContainerStoppingBatchErrorHandler
-
- All Implemented Interfaces:
BatchErrorHandler
,ConsumerAwareBatchErrorHandler
,ContainerAwareBatchErrorHandler
,GenericErrorHandler<org.apache.kafka.clients.consumer.ConsumerRecords<?,?>>
public class ContainerStoppingBatchErrorHandler extends KafkaExceptionLogLevelAware implements ContainerAwareBatchErrorHandler
A container error handler that stops the container after an exception is thrown by the listener.- Since:
- 2.1
- Author:
- Gary Russell
-
-
Constructor Summary
Constructors Constructor Description ContainerStoppingBatchErrorHandler()
Construct an instance with aSimpleAsyncTaskExecutor
.ContainerStoppingBatchErrorHandler(java.util.concurrent.Executor executor)
Construct an instance with the providedExecutor
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
handle(java.lang.Exception thrownException, org.apache.kafka.clients.consumer.ConsumerRecords<?,?> data, org.apache.kafka.clients.consumer.Consumer<?,?> consumer, MessageListenerContainer container)
Handle the exception.-
Methods inherited from class org.springframework.kafka.listener.KafkaExceptionLogLevelAware
getLogLevel, setLogLevel
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.springframework.kafka.listener.ConsumerAwareBatchErrorHandler
handle
-
Methods inherited from interface org.springframework.kafka.listener.ContainerAwareBatchErrorHandler
handle, handle
-
Methods inherited from interface org.springframework.kafka.listener.GenericErrorHandler
clearThreadState, isAckAfterHandle, setAckAfterHandle
-
-
-
-
Constructor Detail
-
ContainerStoppingBatchErrorHandler
public ContainerStoppingBatchErrorHandler()
Construct an instance with aSimpleAsyncTaskExecutor
.
-
ContainerStoppingBatchErrorHandler
public ContainerStoppingBatchErrorHandler(java.util.concurrent.Executor executor)
Construct an instance with the providedExecutor
.- Parameters:
executor
- the executor.
-
-
Method Detail
-
handle
public void handle(java.lang.Exception thrownException, org.apache.kafka.clients.consumer.ConsumerRecords<?,?> data, org.apache.kafka.clients.consumer.Consumer<?,?> consumer, MessageListenerContainer container)
Description copied from interface:BatchErrorHandler
Handle the exception.- Specified by:
handle
in interfaceBatchErrorHandler
- Specified by:
handle
in interfaceConsumerAwareBatchErrorHandler
- Specified by:
handle
in interfaceContainerAwareBatchErrorHandler
- Parameters:
thrownException
- the exception.data
- the consumer records.consumer
- the consumer.container
- the container.
-
-