Class ErrorMessageSendingRecoverer

java.lang.Object
org.springframework.integration.core.ErrorMessagePublisher
org.springframework.integration.handler.advice.ErrorMessageSendingRecoverer
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.retry.RecoveryCallback<Object>

public class ErrorMessageSendingRecoverer extends ErrorMessagePublisher implements org.springframework.retry.RecoveryCallback<Object>
A RecoveryCallback that sends the final throwable as an ErrorMessage after retry exhaustion.
Since:
2.2
  • Constructor Details

    • ErrorMessageSendingRecoverer

      public ErrorMessageSendingRecoverer()
      Construct instance with the default errorChannel to publish recovery error message. The DefaultErrorMessageStrategy is used for building error message to publish.
      Since:
      4.3.10
    • ErrorMessageSendingRecoverer

      public ErrorMessageSendingRecoverer(org.springframework.messaging.MessageChannel channel)
      Construct instance based on the provided message channel. The DefaultErrorMessageStrategy is used for building error message to publish.
      Parameters:
      channel - the message channel to publish error messages on recovery action.
    • ErrorMessageSendingRecoverer

      public ErrorMessageSendingRecoverer(org.springframework.messaging.MessageChannel channel, ErrorMessageStrategy errorMessageStrategy)
      Construct instance based on the provided message channel and ErrorMessageStrategy. In the event provided ErrorMessageStrategy is null, the DefaultErrorMessageStrategy will be used.
      Parameters:
      channel - the message channel to publish error messages on recovery action.
      errorMessageStrategy - the ErrorMessageStrategy to build error message for publishing. Can be null at which point the DefaultErrorMessageStrategy is used.
      Since:
      4.3.10
  • Method Details

    • recover

      public Object recover(org.springframework.retry.RetryContext context)
      Specified by:
      recover in interface org.springframework.retry.RecoveryCallback<Object>
    • payloadWhenNull

      protected Throwable payloadWhenNull(org.springframework.core.AttributeAccessor context)
      Description copied from class: ErrorMessagePublisher
      Build a Throwable payload based on the provided context for future ErrorMessage when there is original Throwable.
      Overrides:
      payloadWhenNull in class ErrorMessagePublisher
      Parameters:
      context - the AttributeAccessor to use for exception properties.
      Returns:
      the Throwable for an ErrorMessage payload.
      See Also: