Class DeserializationException
- java.lang.Object
- 
- java.lang.Throwable
- 
- java.lang.Exception
- 
- java.lang.RuntimeException
- 
- org.springframework.core.NestedRuntimeException
- 
- org.springframework.kafka.KafkaException
- 
- org.springframework.kafka.support.serializer.DeserializationException
 
 
 
 
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable
 
 public class DeserializationException extends KafkaException Exception returned in the consumer record value or key when a deserialization failure occurs.- Since:
- 2.2
- Author:
- Gary Russell, Artem Bilan
- See Also:
- Serialized Form
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.springframework.kafka.KafkaExceptionKafkaException.Level
 
- 
 - 
Constructor SummaryConstructors Constructor Description DeserializationException(java.lang.String message, byte[] data, boolean isKey, java.lang.Throwable cause)Construct an instance with the provided properties.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getData()Get the data that failed deserialization (value or key).org.apache.kafka.common.header.HeadersgetHeaders()Get the headers.booleanisKey()True if deserialization of the key failed, otherwise deserialization of the value failed.voidsetHeaders(org.apache.kafka.common.header.Headers headers)Set the headers.- 
Methods inherited from class org.springframework.kafka.KafkaExceptionselfLog
 - 
Methods inherited from class org.springframework.core.NestedRuntimeExceptioncontains, getMessage, getMostSpecificCause, getRootCause
 
- 
 
- 
- 
- 
Constructor Detail- 
DeserializationExceptionpublic DeserializationException(java.lang.String message, byte[] data, boolean isKey, java.lang.Throwable cause)Construct an instance with the provided properties.- Parameters:
- message- the message.
- data- the data (value or key).
- isKey- true if the exception occurred while deserializing the key.
- cause- the cause.
 
 
- 
 - 
Method Detail- 
getHeaders@Nullable public org.apache.kafka.common.header.Headers getHeaders() Get the headers.- Returns:
- the headers.
 
 - 
setHeaderspublic void setHeaders(@Nullable org.apache.kafka.common.header.Headers headers)Set the headers.- Parameters:
- headers- the headers.
 
 - 
getDatapublic byte[] getData() Get the data that failed deserialization (value or key).- Returns:
- the data.
 
 - 
isKeypublic boolean isKey() True if deserialization of the key failed, otherwise deserialization of the value failed.- Returns:
- true for the key.
 
 
- 
 
-