Interface RabbitListenerErrorHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An error handler which is called when a {code @RabbitListener} method
throws an exception. This is invoked higher up the stack than the
listener container's error handler.
- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault ObjecthandleError(org.springframework.amqp.core.Message amqpMessage, com.rabbitmq.client.Channel channel, org.springframework.messaging.Message<?> message, ListenerExecutionFailedException exception) Handle the error.handleError(org.springframework.amqp.core.Message amqpMessage, org.springframework.messaging.Message<?> message, ListenerExecutionFailedException exception) Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Details
-
handleError
@Deprecated(forRemoval=true, since="3.1.3") Object handleError(org.springframework.amqp.core.Message amqpMessage, @Nullable org.springframework.messaging.Message<?> message, ListenerExecutionFailedException exception) throws Exception Deprecated, for removal: This API element is subject to removal in a future version.Handle the error. If an exception is not thrown, the return value is returned to the sender using normalreplyTo/@SendTosemantics.- Parameters:
amqpMessage- the raw message received.message- the converted spring-messaging message (if available).exception- the exception the listener threw, wrapped in aListenerExecutionFailedException.- Returns:
- the return value to be sent to the sender.
- Throws:
Exception- an exception which may be the original or different.
-
handleError
default Object handleError(org.springframework.amqp.core.Message amqpMessage, com.rabbitmq.client.Channel channel, @Nullable org.springframework.messaging.Message<?> message, ListenerExecutionFailedException exception) throws Exception Handle the error. If an exception is not thrown, the return value is returned to the sender using normalreplyTo/@SendTosemantics.- Parameters:
amqpMessage- the raw message received.channel- AMQP channel for manual acks.message- the converted spring-messaging message (if available).exception- the exception the listener threw, wrapped in aListenerExecutionFailedException.- Returns:
- the return value to be sent to the sender.
- Throws:
Exception- an exception which may be the original or different.- Since:
- 3.1.3
-
handleError(Message, Channel, org.springframework.messaging.Message, ListenerExecutionFailedException)