Package org.apache.kafka.streams.errors
Interface DeserializationExceptionHandler
-
- All Superinterfaces:
Configurable
- All Known Implementing Classes:
LogAndContinueExceptionHandler
,LogAndFailExceptionHandler
public interface DeserializationExceptionHandler extends Configurable
Interface that specifies how an exception from source node deserialization (e.g., reading from Kafka) should be handled.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
DeserializationExceptionHandler.DeserializationHandlerResponse
Enumeration that describes the response from the exception handler.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DeserializationExceptionHandler.DeserializationHandlerResponse
handle(ProcessorContext context, ConsumerRecord<byte[],byte[]> record, Exception exception)
Inspect a record and the exception received.-
Methods inherited from interface org.apache.kafka.common.Configurable
configure
-
-
-
-
Method Detail
-
handle
DeserializationExceptionHandler.DeserializationHandlerResponse handle(ProcessorContext context, ConsumerRecord<byte[],byte[]> record, Exception exception)
Inspect a record and the exception received.Note, that the passed in
ProcessorContext
only 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 contextrecord
- record that failed deserializationexception
- the actual exception
-
-