Interface KafkaListenerErrorHandler
-
- All Known Subinterfaces:
ConsumerAwareListenerErrorHandler
- 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 KafkaListenerErrorHandler
An error handler which is called when a@KafkaListener
method throws an exception. This is invoked higher up the stack than the listener container's error handler. For methods annotated with@SendTo
, the error handler can return a result.- Since:
- 1.3
- Author:
- Venil Noronha, Gary Russell, Artem Bilan
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.Object
handleError(org.springframework.messaging.Message<?> message, ListenerExecutionFailedException exception)
Handle the error.default java.lang.Object
handleError(org.springframework.messaging.Message<?> message, ListenerExecutionFailedException exception, org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
Handle the error.
-
-
-
Method Detail
-
handleError
java.lang.Object handleError(org.springframework.messaging.Message<?> message, ListenerExecutionFailedException exception)
Handle the error.- Parameters:
message
- the spring-messaging message.exception
- the exception the listener threw, wrapped in aListenerExecutionFailedException
.- Returns:
- the return value is ignored unless the annotated method has a
@SendTo
annotation.
-
handleError
default java.lang.Object handleError(org.springframework.messaging.Message<?> message, ListenerExecutionFailedException exception, org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
Handle the error.- Parameters:
message
- the spring-messaging message.exception
- the exception the listener threw, wrapped in aListenerExecutionFailedException
.consumer
- the consumer.- Returns:
- the return value is ignored unless the annotated method has a
@SendTo
annotation.
-
-