@Singleton @Primary public class DefaultKafkaListenerExceptionHandler extends java.lang.Object implements KafkaListenerExceptionHandler
KafkaConsumer
fails to process a ConsumerRecord
. By default just logs the error.Constructor and Description |
---|
DefaultKafkaListenerExceptionHandler() |
Modifier and Type | Method and Description |
---|---|
void |
handle(KafkaListenerException exception) |
protected void |
seekPastDeserializationError(org.apache.kafka.common.errors.SerializationException cause,
java.lang.Object consumerBean,
org.apache.kafka.clients.consumer.Consumer<?,?> kafkaConsumer)
Seeks past a serialization exception if an error occurs.
|
void |
setSkipRecordOnDeserializationFailure(boolean skipRecordOnDeserializationFailure)
Sets whether the seek past records that are not deserializable.
|
public DefaultKafkaListenerExceptionHandler()
public void handle(KafkaListenerException exception)
handle
in interface io.micronaut.core.exceptions.ExceptionHandler<KafkaListenerException>
public void setSkipRecordOnDeserializationFailure(boolean skipRecordOnDeserializationFailure)
skipRecordOnDeserializationFailure
- True if records that are not deserializable should be skipped.protected void seekPastDeserializationError(@Nonnull org.apache.kafka.common.errors.SerializationException cause, @Nonnull java.lang.Object consumerBean, @Nonnull org.apache.kafka.clients.consumer.Consumer<?,?> kafkaConsumer)
cause
- The causeconsumerBean
- The consumer beankafkaConsumer
- The kafka consumer