Interface ErrorHandler<K,​V>

  • Type Parameters:
    K - key class of the record
    V - value class of the record
    All Known Implementing Classes:
    IgnoreAndProceedErrorHandler
    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 ErrorHandler<K,​V>
    Interface for handling errors that might occur during the processing of Kafka records. Be aware that the key or value can be null if the WrappedNoSerializationErrorDeserializer is used.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean handleError​(org.apache.kafka.clients.consumer.ConsumerRecord<K,​V> consumerRecord, java.lang.RuntimeException e, org.apache.kafka.clients.consumer.Consumer<K,​V> consumer)
      handling error that happenes during processing of the consumer record
    • Method Detail

      • handleError

        boolean handleError​(org.apache.kafka.clients.consumer.ConsumerRecord<K,​V> consumerRecord,
                            java.lang.RuntimeException e,
                            org.apache.kafka.clients.consumer.Consumer<K,​V> consumer)
        handling error that happenes during processing of the consumer record
        Parameters:
        consumerRecord - consumer record that caused the error
        e - error that occured
        consumer - consumer that read the record
        Returns:
        if false, the listener should stop consuming messages