Class RetryingBatchErrorHandler

    • Constructor Detail

      • RetryingBatchErrorHandler

        public RetryingBatchErrorHandler()
        Construct an instance with a default FixedBackOff (unlimited attempts with a 5 second back off).
      • RetryingBatchErrorHandler

        public RetryingBatchErrorHandler​(org.springframework.util.backoff.BackOff backOff,
                                         @Nullable
                                         ConsumerRecordRecoverer recoverer)
        Construct an instance with the provided BackOff and ConsumerRecordRecoverer. If the recoverer is null, the discarded records (topic-partition@offset) will be logged.
        Parameters:
        backOff - the back off.
        recoverer - the recoverer.
    • Method Detail

      • isAckAfterHandle

        public boolean isAckAfterHandle()
        Description copied from interface: GenericErrorHandler
        Return true if the offset should be committed for a handled error (no exception thrown).
        Specified by:
        isAckAfterHandle in interface GenericErrorHandler<org.apache.kafka.clients.consumer.ConsumerRecords<?,​?>>
        Returns:
        true to commit.
      • setAckAfterHandle

        public void setAckAfterHandle​(boolean ackAfterHandle)
        Description copied from interface: GenericErrorHandler
        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).
        Specified by:
        setAckAfterHandle in interface GenericErrorHandler<org.apache.kafka.clients.consumer.ConsumerRecords<?,​?>>
        Parameters:
        ackAfterHandle - false to not commit.