public interface DeserializationExceptionHandler
extends org.apache.kafka.common.Configurable
Modifier and Type | Interface and Description |
---|---|
static class |
DeserializationExceptionHandler.DeserializationHandlerResponse
Enumeration that describes the response from the exception handler.
|
Modifier and Type | Method and Description |
---|---|
default DeserializationExceptionHandler.DeserializationHandlerResponse |
handle(ErrorHandlerContext context,
org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]> record,
Exception exception)
Inspect a record and the exception received.
|
default DeserializationExceptionHandler.DeserializationHandlerResponse |
handle(ProcessorContext context,
org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]> record,
Exception exception)
Deprecated.
Since 3.9. Use
handle(ErrorHandlerContext, ConsumerRecord, Exception) instead. |
@Deprecated default DeserializationExceptionHandler.DeserializationHandlerResponse handle(ProcessorContext context, org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]> record, Exception exception)
handle(ErrorHandlerContext, ConsumerRecord, Exception)
instead.
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.
context
- processor contextrecord
- record that failed deserializationexception
- the actual exceptiondefault DeserializationExceptionHandler.DeserializationHandlerResponse handle(ErrorHandlerContext context, org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]> record, Exception exception)
context
- error handler contextrecord
- record that failed deserializationexception
- the actual exception