public class LogAndFailExceptionHandler extends Object implements DeserializationExceptionHandler
DeserializationExceptionHandler.DeserializationHandlerResponse
Constructor and Description |
---|
LogAndFailExceptionHandler() |
Modifier and Type | Method and Description |
---|---|
void |
configure(Map<String,?> configs) |
DeserializationExceptionHandler.DeserializationHandlerResponse |
handle(ProcessorContext context,
org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]> record,
Exception exception)
Inspect a record and the exception received.
|
public DeserializationExceptionHandler.DeserializationHandlerResponse handle(ProcessorContext context, org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]> record, Exception exception)
DeserializationExceptionHandler
Note, that the passed in ProcessorContext
only allows to access metadata like the task ID.
However, it cannot be used to emit records via ProcessorContext.forward(Object, Object)
;
calling forward()
(and some other methods) would result in a runtime exception.
handle
in interface DeserializationExceptionHandler
context
- processor contextrecord
- record that failed deserializationexception
- the actual exception