Interface BatchErrorHandler

All Superinterfaces:
GenericErrorHandler<org.apache.kafka.clients.consumer.ConsumerRecords<?,?>>
All Known Subinterfaces:
ConsumerAwareBatchErrorHandler, ContainerAwareBatchErrorHandler, ListenerInvokingBatchErrorHandler
All Known Implementing Classes:
BatchLoggingErrorHandler, ConditionalDelegatingBatchErrorHandler, ContainerStoppingBatchErrorHandler, RecoveringBatchErrorHandler, RetryingBatchErrorHandler, SeekToCurrentBatchErrorHandler

public interface BatchErrorHandler extends GenericErrorHandler<org.apache.kafka.clients.consumer.ConsumerRecords<?,?>>
Handles errors thrown during the execution of a BatchMessageListener. The listener should communicate which position(s) in the list failed in the exception.
Since:
1.1
  • Method Details

    • handle

      default void handle(Exception thrownException, @Nullable org.apache.kafka.clients.consumer.ConsumerRecords<?,?> data, org.apache.kafka.clients.consumer.Consumer<?,?> consumer, MessageListenerContainer container)
      Handle the exception.
      Parameters:
      thrownException - the exception.
      data - the consumer records.
      consumer - the consumer.
      container - the container.
    • handle

      default void handle(Exception thrownException, @Nullable org.apache.kafka.clients.consumer.ConsumerRecords<?,?> data, org.apache.kafka.clients.consumer.Consumer<?,?> consumer, MessageListenerContainer container, Runnable invokeListener)
      Handle the exception.
      Parameters:
      thrownException - the exception.
      data - the consumer records.
      consumer - the consumer.
      container - the container.
      invokeListener - a callback to re-invoke the listener.
      Since:
      2.3.7