Class FailedBatchProcessor

All Implemented Interfaces:
DeliveryAttemptAware
Direct Known Subclasses:
DefaultErrorHandler

public abstract class FailedBatchProcessor extends FailedRecordProcessor
Subclass of FailedRecordProcessor that can process (and recover) a batch. If the listener throws a BatchListenerFailedException, the offsets prior to the failed record are committed and the remaining records have seeks performed. When the retries are exhausted, the failed record is sent to the recoverer instead of being included in the seeks. If other exceptions are thrown, the fallback handler takes the processing.
Since:
2.8
  • Constructor Details

    • FailedBatchProcessor

      public FailedBatchProcessor(@Nullable BiConsumer<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>, Exception> recoverer, org.springframework.util.backoff.BackOff backOff, CommonErrorHandler fallbackHandler)
      Construct an instance with the provided properties.
      Parameters:
      recoverer - the recoverer.
      backOff - the back off.
      fallbackHandler - the fallback handler.
    • FailedBatchProcessor

      public FailedBatchProcessor(@Nullable BiConsumer<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>, Exception> recoverer, org.springframework.util.backoff.BackOff backOff, @Nullable BackOffHandler backOffHandler, CommonErrorHandler fallbackHandler)
      Construct an instance with the provided properties.
      Parameters:
      recoverer - the recoverer.
      backOff - the back off.
      backOffHandler - the BackOffHandler
      fallbackHandler - the fallback handler.
      Since:
      2.9
  • Method Details