Interface AmqpListenerErrorHandler

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface AmqpListenerErrorHandler
An error handler which is called when a @AmqpListener method throws an exception. This is invoked higher up the stack than the listener container's error handler.
Since:
4.1
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable Object
    handleError(org.apache.qpid.protonj2.client.Delivery delivery, @Nullable org.springframework.messaging.Message<?> message, org.springframework.amqp.listener.ListenerExecutionFailedException exception)
    Handle the error.
  • Method Details

    • handleError

      @Nullable Object handleError(org.apache.qpid.protonj2.client.Delivery delivery, @Nullable org.springframework.messaging.Message<?> message, org.springframework.amqp.listener.ListenerExecutionFailedException exception) throws Exception
      Handle the error. If an exception is not thrown, the return value is returned to the sender using normal replyTo/@SendTo semantics.
      Parameters:
      delivery - the ProtonJ delivery that failed.
      message - the converted spring-messaging message (if available).
      exception - the exception the listener threw, wrapped in a ListenerExecutionFailedException.
      Returns:
      the return value (if any) to be sent to the sender as error compensation.
      Throws:
      Exception - an exception which may be the original or different.