Interface DeserializationExceptionHandler
- All Superinterfaces:
org.apache.kafka.common.Configurable
- All Known Implementing Classes:
LogAndContinueExceptionHandler,LogAndFailExceptionHandler
public interface DeserializationExceptionHandler extends org.apache.kafka.common.Configurable
Interface that specifies how an exception from source node deserialization (e.g., reading from Kafka) should be handled.
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumEnumeration that describes the response from the exception handler.Method Summary
Modifier and TypeMethodDescriptionhandle(ErrorHandlerContext context, org.apache.kafka.clients.consumer.ConsumerRecord<byte[], byte[]> record, Exception exception) Inspect a record and the exception received.handle(ProcessorContext context, org.apache.kafka.clients.consumer.ConsumerRecord<byte[], byte[]> record, Exception exception) Deprecated.Since 3.9.Methods inherited from interface org.apache.kafka.common.Configurable
configure
Method Details
handle
@Deprecateddefault DeserializationExceptionHandler.DeserializationHandlerResponse handle(ProcessorContext context, org.apache.kafka.clients.consumer.ConsumerRecord<byte[], byte[]> record, Exception exception) Deprecated.Since 3.9. Usehandle(ErrorHandlerContext, ConsumerRecord, Exception)instead.Inspect a record and the exception received.Note, that the passed in
ProcessorContextonly allows to access metadata like the task ID. However, it cannot be used to emit records viaProcessorContext.forward(Object, Object); callingforward()(and some other methods) would result in a runtime exception.- Parameters:
context- Processor context.record- Record that failed deserialization.exception- The actual exception.- Returns:
- Whether to continue or stop processing.
handle
default DeserializationExceptionHandler.DeserializationHandlerResponse handle(ErrorHandlerContext context, org.apache.kafka.clients.consumer.ConsumerRecord<byte[], byte[]> record, Exception exception) Inspect a record and the exception received.- Parameters:
context- Error handler context.record- Record that failed deserialization.exception- The actual exception.- Returns:
- Whether to continue or stop processing.