Interface GenericErrorHandler<T>

Type Parameters:
T - the data type.
All Known Subinterfaces:
BatchErrorHandler, ConsumerAwareBatchErrorHandler, ConsumerAwareErrorHandler, ContainerAwareBatchErrorHandler, ContainerAwareErrorHandler, ErrorHandler, ListenerInvokingBatchErrorHandler, RemainingRecordsErrorHandler
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@Deprecated(since="2.8", forRemoval=true) @FunctionalInterface public interface GenericErrorHandler<T>
Deprecated, for removal: This API element is subject to removal in a future version.
in favor of CommonErrorHandler.
A generic error handler.
Since:
1.1
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Optional method to clear thread state; will be called just before a consumer thread terminates.
    void
    handle(Exception thrownException, T data)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Handle the exception.
    default void
    handle(Exception thrownException, T data, org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Handle the exception.
    default boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Return true if the offset should be committed for a handled error (no exception thrown).
    default void
    setAckAfterHandle(boolean ack)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set to false to prevent the container from committing the offset of a recovered record (when the error handler does not itself throw an exception).
  • Method Details

    • handle

      void handle(Exception thrownException, @Nullable T data)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Handle the exception.
      Parameters:
      thrownException - The exception.
      data - the data.
    • handle

      default void handle(Exception thrownException, @Nullable T data, org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Handle the exception.
      Parameters:
      thrownException - The exception.
      data - the data.
      consumer - the consumer.
    • clearThreadState

      default void clearThreadState()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Optional method to clear thread state; will be called just before a consumer thread terminates.
      Since:
      2.3
    • isAckAfterHandle

      default boolean isAckAfterHandle()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return true if the offset should be committed for a handled error (no exception thrown).
      Returns:
      true to commit.
      Since:
      2.3.2
    • setAckAfterHandle

      default void setAckAfterHandle(boolean ack)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set to false to prevent the container from committing the offset of a recovered record (when the error handler does not itself throw an exception).
      Parameters:
      ack - false to not commit.
      Since:
      2.5.6