Annotation Interface ErrorStrategy


@Documented @Retention(RUNTIME) public @interface ErrorStrategy
Setting the error strategy allows you to resume at the next offset or to seek the consumer (stop on error) to the failed offset so that it can retry if an error occurs. The consumer bean is still able to implement a custom exception handler to replace DefaultKafkaListenerExceptionHandler as well as set the error strategy.
Since:
4.1
Author:
Christopher Webb, Vishal Sulibhavi, Denis Stepanov
  • Field Details

    • DEFAULT_DELAY_IN_SECONDS

      static final int DEFAULT_DELAY_IN_SECONDS
      Default retry delay in seconds.
      See Also:
    • DEFAULT_RETRY_COUNT

      static final int DEFAULT_RETRY_COUNT
      Default retry attempts.
      See Also:
  • Element Details

    • retryDelay

      String retryDelay
      The delay used with RETRY_ON_ERROR and RETRY_EXPONENTIALLY_ON_ERROR ErrorStrategyValue.
      Returns:
      the delay by which to wait for the next retry
      Default:
      "1s"
    • retryCount

      int retryCount
      The retry count used with RETRY_ON_ERROR and RETRY_EXPONENTIALLY_ON_ERROR ErrorStrategyValue.
      Returns:
      the retry count of how many attempts should be made
      Default:
      1
    • value

      The strategy to use when an error occurs, see ErrorStrategyValue.
      Returns:
      the error strategy
      Default:
      NONE
    • exceptionTypes

      Class<? extends Throwable>[] exceptionTypes
      The types of exceptions to retry, used with RETRY_ON_ERROR, see ErrorStrategyValue.
      Returns:
      the list of exceptions types
      Since:
      4.5.0
      Default:
      {}