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 the
DefaultErrorHandler
for such situations.- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault Object
handleError
(org.springframework.messaging.Message<?> message, ListenerExecutionFailedException exception) Handle the error.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 Details
-
handleError
default 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
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.
-