Package org.apache.kafka.streams.errors
Interface DeserializationExceptionHandler
- All Superinterfaces:
Configurable
- All Known Implementing Classes:
LogAndContinueExceptionHandler
,LogAndFailExceptionHandler
Interface that specifies how an exception from source node deserialization
(e.g., reading from Kafka) should be handled.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Enumeration that describes the response from the exception handler. -
Method Summary
Modifier and TypeMethodDescriptionhandle
(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 Details
-
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
-