Class FailedBatchProcessor

    • Constructor Detail

      • FailedBatchProcessor

        public FailedBatchProcessor​(@Nullable
                                    java.util.function.BiConsumer<org.apache.kafka.clients.consumer.ConsumerRecord<?,​?>,​java.lang.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 fall back handler.
    • Method Detail

      • notRetryable

        protected void notRetryable​(java.util.stream.Stream<java.lang.Class<? extends java.lang.Exception>> notRetryable)
        Description copied from class: ExceptionClassifier
        Subclasses can override this to receive notification of configuration of not retryable exceptions.
        Overrides:
        notRetryable in class ExceptionClassifier
        Parameters:
        notRetryable - the not retryable exceptions.
      • setClassifications

        public void setClassifications​(java.util.Map<java.lang.Class<? extends java.lang.Throwable>,​java.lang.Boolean> classifications,
                                       boolean defaultValue)
        Description copied from class: ExceptionClassifier
        Set an exception classifications to determine whether the exception should cause a retry (until exhaustion) or not. If not, we go straight to the recoverer. By default, the following exceptions will not be retried:
        • DeserializationException
        • MessageConversionException
        • MethodArgumentResolutionException
        • NoSuchMethodException
        • ClassCastException
        All others will be retried. When calling this method, the defaults will not be applied.
        Overrides:
        setClassifications in class ExceptionClassifier
        Parameters:
        classifications - the classifications.
        defaultValue - whether or not to retry non-matching exceptions.
        See Also:
        BinaryExceptionClassifier(Map, boolean), ExceptionClassifier.addNotRetryableExceptions(Class...)
      • getFallbackBatchHandler

        protected CommonErrorHandler getFallbackBatchHandler()
        Return the fallback batch error handler.
        Returns:
        the handler.
        Since:
        2.8.8
      • doHandle

        protected void doHandle​(java.lang.Exception thrownException,
                                org.apache.kafka.clients.consumer.ConsumerRecords<?,​?> data,
                                org.apache.kafka.clients.consumer.Consumer<?,​?> consumer,
                                MessageListenerContainer container,
                                java.lang.Runnable invokeListener)