Package org.apache.kafka.streams.errors
Class LogAndFailExceptionHandler
- java.lang.Object
-
- org.apache.kafka.streams.errors.LogAndFailExceptionHandler
-
- All Implemented Interfaces:
Configurable
,DeserializationExceptionHandler
public class LogAndFailExceptionHandler extends Object implements DeserializationExceptionHandler
Deserialization handler that logs a deserialization exception and then signals the processing pipeline to stop processing more records and fail.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.kafka.streams.errors.DeserializationExceptionHandler
DeserializationExceptionHandler.DeserializationHandlerResponse
-
-
Constructor Summary
Constructors Constructor Description LogAndFailExceptionHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(Map<String,?> configs)
Configure this class with the given key-value pairsDeserializationExceptionHandler.DeserializationHandlerResponse
handle(ProcessorContext context, ConsumerRecord<byte[],byte[]> record, Exception exception)
Inspect a record and the exception received.
-
-
-
Method Detail
-
handle
public DeserializationExceptionHandler.DeserializationHandlerResponse handle(ProcessorContext context, ConsumerRecord<byte[],byte[]> record, Exception exception)
Description copied from interface:DeserializationExceptionHandler
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.- Specified by:
handle
in interfaceDeserializationExceptionHandler
- Parameters:
context
- processor contextrecord
- record that failed deserializationexception
- the actual exception
-
configure
public void configure(Map<String,?> configs)
Description copied from interface:Configurable
Configure this class with the given key-value pairs- Specified by:
configure
in interfaceConfigurable
-
-