Interface RecoveryStrategy

  • 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 RecoveryStrategy
    Called to determine whether a record should be skipped.
    Since:
    2.7
    Author:
    Gary Russell
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean recovered​(org.apache.kafka.clients.consumer.ConsumerRecord<?,​?> record, java.lang.Exception ex, MessageListenerContainer container, org.apache.kafka.clients.consumer.Consumer<?,​?> consumer)
      Return true if the record should be skipped because it was successfully recovered.
    • Method Detail

      • recovered

        boolean recovered​(org.apache.kafka.clients.consumer.ConsumerRecord<?,​?> record,
                          java.lang.Exception ex,
                          @Nullable
                          MessageListenerContainer container,
                          @Nullable
                          org.apache.kafka.clients.consumer.Consumer<?,​?> consumer)
                   throws java.lang.InterruptedException
        Return true if the record should be skipped because it was successfully recovered.
        Parameters:
        record - the record.
        ex - the exception.
        container - the container (or parent if a child container).
        consumer - the consumer.
        Returns:
        true to skip.
        Throws:
        java.lang.InterruptedException - if the thread is interrupted.