Interface RemainingRecordsErrorHandler
-
- All Superinterfaces:
ConsumerAwareErrorHandler,ErrorHandler,GenericErrorHandler<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>>
- All Known Subinterfaces:
ContainerAwareErrorHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface RemainingRecordsErrorHandler extends ConsumerAwareErrorHandler
An error handler that has access to the unprocessed records from the last poll (including the failed record) and the consumer, for example to adjust offsets after an error. The records passed to the handler will not be passed to the listener (unless re-fetched if the handler performs seeks).- Since:
- 2.0.1
- Author:
- Gary Russell
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidhandle(java.lang.Exception thrownException, java.util.List<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>> records, org.apache.kafka.clients.consumer.Consumer<?,?> consumer)Handle the exception.default voidhandle(java.lang.Exception thrownException, java.util.List<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>> records, org.apache.kafka.clients.consumer.Consumer<?,?> consumer, MessageListenerContainer container)Handle the exception.default voidhandle(java.lang.Exception thrownException, org.apache.kafka.clients.consumer.ConsumerRecord<?,?> data, org.apache.kafka.clients.consumer.Consumer<?,?> consumer)Handle the exception.-
Methods inherited from interface org.springframework.kafka.listener.ConsumerAwareErrorHandler
handle
-
Methods inherited from interface org.springframework.kafka.listener.GenericErrorHandler
clearThreadState, isAckAfterHandle, setAckAfterHandle
-
-
-
-
Method Detail
-
handle
default void handle(java.lang.Exception thrownException, @Nullable org.apache.kafka.clients.consumer.ConsumerRecord<?,?> data, org.apache.kafka.clients.consumer.Consumer<?,?> consumer)Description copied from interface:GenericErrorHandlerHandle the exception.- Specified by:
handlein interfaceConsumerAwareErrorHandler- Specified by:
handlein interfaceGenericErrorHandler<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>>- Parameters:
thrownException- The exception.data- the data.consumer- the consumer.
-
handle
void handle(java.lang.Exception thrownException, @Nullable java.util.List<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>> records, org.apache.kafka.clients.consumer.Consumer<?,?> consumer)Handle the exception. The failed record is the first in the list.- Parameters:
thrownException- the exception.records- the remaining records including the one that failed.consumer- the consumer.
-
handle
default void handle(java.lang.Exception thrownException, @Nullable java.util.List<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>> records, org.apache.kafka.clients.consumer.Consumer<?,?> consumer, MessageListenerContainer container)Description copied from interface:ErrorHandlerHandle the exception.- Specified by:
handlein interfaceConsumerAwareErrorHandler- Specified by:
handlein interfaceErrorHandler- Parameters:
thrownException- the exception.records- the remaining records including the one that failed.consumer- the consumer.container- the container.
-
-