Interface ConsumerAwareListenerErrorHandler
-
- All Superinterfaces:
KafkaListenerErrorHandler
- 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 ConsumerAwareListenerErrorHandler extends KafkaListenerErrorHandler
An error handler that has access to the consumer. IMPORTANT: do not perform seek operations on the consumer, the container won't be aware. Use a container-level error handler such as theDefaultErrorHandler
for such situations.- Since:
- 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.Object
handleError(org.springframework.messaging.Message<?> message, ListenerExecutionFailedException exception)
Handle the error.java.lang.Object
handleError(org.springframework.messaging.Message<?> message, ListenerExecutionFailedException exception, org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
Handle the error.-
Methods inherited from interface org.springframework.kafka.listener.KafkaListenerErrorHandler
handleError
-
-
-
-
Method Detail
-
handleError
default java.lang.Object handleError(org.springframework.messaging.Message<?> message, ListenerExecutionFailedException exception)
Description copied from interface:KafkaListenerErrorHandler
Handle the error.- Specified by:
handleError
in interfaceKafkaListenerErrorHandler
- 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
java.lang.Object handleError(org.springframework.messaging.Message<?> message, ListenerExecutionFailedException exception, org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
Description copied from interface:KafkaListenerErrorHandler
Handle the error.- Specified by:
handleError
in interfaceKafkaListenerErrorHandler
- 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.
-
-