Interface GenericErrorHandler<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void clearThreadState()
      Optional method to clear thread state; will be called just before a consumer thread terminates.
      void handle​(java.lang.Exception thrownException, T data)
      Handle the exception.
      default void handle​(java.lang.Exception thrownException, T data, org.apache.kafka.clients.consumer.Consumer<?,​?> consumer)
      Handle the exception.
      default boolean isAckAfterHandle()
      Return true if the offset should be committed for a handled error (no exception thrown).
      default void setAckAfterHandle​(boolean ack)
      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 Detail

      • handle

        void handle​(java.lang.Exception thrownException,
                    T data)
        Handle the exception.
        Parameters:
        thrownException - The exception.
        data - the data.
      • handle

        default void handle​(java.lang.Exception thrownException,
                            T data,
                            org.apache.kafka.clients.consumer.Consumer<?,​?> consumer)
        Handle the exception.
        Parameters:
        thrownException - The exception.
        data - the data.
        consumer - the consumer.
      • clearThreadState

        default void clearThreadState()
        Optional method to clear thread state; will be called just before a consumer thread terminates.
        Since:
        2.3
      • isAckAfterHandle

        default boolean isAckAfterHandle()
        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)
        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