Class SeekToCurrentBatchErrorHandler
java.lang.Object
org.springframework.kafka.listener.KafkaExceptionLogLevelAware
org.springframework.kafka.listener.SeekToCurrentBatchErrorHandler
- All Implemented Interfaces:
BatchErrorHandler,ConsumerAwareBatchErrorHandler,ContainerAwareBatchErrorHandler,GenericErrorHandler<org.apache.kafka.clients.consumer.ConsumerRecords<?,?>>
@Deprecated
public class SeekToCurrentBatchErrorHandler
extends KafkaExceptionLogLevelAware
implements ContainerAwareBatchErrorHandler
Deprecated.
An error handler that seeks to the current offset for each topic in a batch of records.
Used to rewind partitions after a message failure so that the batch can be replayed.
- Since:
- 2.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.Optional method to clear thread state; will be called just before a consumer thread terminates.voidhandle(Exception thrownException, org.apache.kafka.clients.consumer.ConsumerRecords<?, ?> data, org.apache.kafka.clients.consumer.Consumer<?, ?> consumer, MessageListenerContainer container) Deprecated.Handle the exception.voidsetBackOff(org.springframework.util.backoff.BackOff backOff) Deprecated.Set aBackOffto suspend the thread after performing the seek.Methods inherited from class org.springframework.kafka.listener.KafkaExceptionLogLevelAware
getLogLevel, setLogLevelMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.kafka.listener.ConsumerAwareBatchErrorHandler
handleMethods inherited from interface org.springframework.kafka.listener.ContainerAwareBatchErrorHandler
handle, handleMethods inherited from interface org.springframework.kafka.listener.GenericErrorHandler
isAckAfterHandle, setAckAfterHandle
-
Constructor Details
-
SeekToCurrentBatchErrorHandler
public SeekToCurrentBatchErrorHandler()Deprecated.
-
-
Method Details
-
setBackOff
public void setBackOff(org.springframework.util.backoff.BackOff backOff) Deprecated.Set aBackOffto suspend the thread after performing the seek. Since this error handler can never "recover" after retries are exhausted, if the back off returns STOP, then the previous interval is used.- Parameters:
backOff- the back off.- Since:
- 2.3
-
handle
public void handle(Exception thrownException, @Nullable org.apache.kafka.clients.consumer.ConsumerRecords<?, ?> data, org.apache.kafka.clients.consumer.Consumer<?, ?> consumer, MessageListenerContainer container) Deprecated.Description copied from interface:BatchErrorHandlerHandle the exception.- Specified by:
handlein interfaceBatchErrorHandler- Specified by:
handlein interfaceConsumerAwareBatchErrorHandler- Specified by:
handlein interfaceContainerAwareBatchErrorHandler- Parameters:
thrownException- the exception.data- the consumer records.consumer- the consumer.container- the container.
-
clearThreadState
public void clearThreadState()Deprecated.Description copied from interface:GenericErrorHandlerOptional method to clear thread state; will be called just before a consumer thread terminates.- Specified by:
clearThreadStatein interfaceGenericErrorHandler<org.apache.kafka.clients.consumer.ConsumerRecords<?,?>>
-
DefaultErrorHandlerwith an infiniteBackOff.