Class DeserializationExceptionHandler.Response
java.lang.Object
org.apache.kafka.streams.errors.DeserializationExceptionHandler.Response
- Enclosing interface:
DeserializationExceptionHandler
Represents the result of handling a deserialization exception.
The Response class encapsulates a DeserializationExceptionHandler.Result,
indicating whether processing should continue or fail, along with an optional list of
ProducerRecord instances to be sent to a dead letter queue.
-
Method Summary
Modifier and TypeMethodDescriptionList<org.apache.kafka.clients.producer.ProducerRecord<byte[], byte[]>> Retrieves an unmodifiable list of records to be sent to the dead letter queue.fail()Creates aResponseindicating that processing should fail.Creates aResponseindicating that processing should fail.result()Retrieves the deserialization handler result.resume()Creates aResponseindicating that processing should continue.resume(List<org.apache.kafka.clients.producer.ProducerRecord<byte[], byte[]>> deadLetterQueueRecords) Creates aResponseindicating that processing should continue.
-
Method Details
-
fail
public static DeserializationExceptionHandler.Response fail(List<org.apache.kafka.clients.producer.ProducerRecord<byte[], byte[]>> deadLetterQueueRecords) Creates aResponseindicating that processing should fail.- Parameters:
deadLetterQueueRecords- the list of records to be sent to the dead letter queue; may benull.- Returns:
- a
Responsewith aDeserializationExceptionHandler.Result.FAILstatus.
-
fail
Creates aResponseindicating that processing should fail.- Returns:
- a
Responsewith aDeserializationExceptionHandler.Result.FAILstatus.
-
resume
public static DeserializationExceptionHandler.Response resume(List<org.apache.kafka.clients.producer.ProducerRecord<byte[], byte[]>> deadLetterQueueRecords) Creates aResponseindicating that processing should continue.- Parameters:
deadLetterQueueRecords- the list of records to be sent to the dead letter queue; may benull.- Returns:
- a
Responsewith aDeserializationExceptionHandler.Result.RESUMEstatus.
-
resume
Creates aResponseindicating that processing should continue.- Returns:
- a
Responsewith aDeserializationExceptionHandler.Result.RESUMEstatus.
-
result
Retrieves the deserialization handler result.- Returns:
- the
DeserializationExceptionHandler.Resultindicating whether processing should continue or fail.
-
deadLetterQueueRecords
public List<org.apache.kafka.clients.producer.ProducerRecord<byte[],byte[]>> deadLetterQueueRecords()Retrieves an unmodifiable list of records to be sent to the dead letter queue.If the list is
null, an empty list is returned.- Returns:
- an unmodifiable list of
ProducerRecordinstances for the dead letter queue, or an empty list if no records are available.
-