Kafka Exception RecordDeserializationException
org.apache.kafka.common.errors.RecordDeserializationException
Non-retriable
Serialization
This exception is raised for any error that occurs while deserializing records received by the consumer using the configured Deserializer.
Common Causes
- A 'poison pill' record on the partition cannot be deserialized by the configured value.deserializer (corrupt bytes or a different format than expected)
- Schema mismatch: the record was produced with a schema the consumer's deserializer cannot resolve (Schema Registry subject/version drift)
- Mixing serializers on the same topic (e.g. some records JSON, some Avro)
Solutions
- Use ErrorHandlingDeserializer (Spring Kafka) or catch the exception and seek past the offending offset to keep the consumer alive
- Route undeserializable records to a dead-letter topic with their original bytes and headers for later inspection
- The exception exposes the topic-partition and offset — use kafka-console-consumer to dump that exact offset and inspect the raw bytes
Example Stack Trace
org.apache.kafka.common.errors.RecordDeserializationException: Error deserializing key/value for partition orders-0 at offset 42891. If needed, please seek past the record to continue consumption.
at org.apache.kafka.clients.consumer.internals.CompletedFetch.parseRecord(CompletedFetch.java:331)Diagnostic Commands
# Dump the exact offending record's raw bytes
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic orders --partition 0 --offset 42891 --max-messages 1 --property print.key=trueRelated
Related Serialization exceptions: SerializationException
Hitting
RecordDeserializationException in production? Conduktor Console gives you real-time visibility into clients, consumer groups, and broker health. Browse every Kafka exception or protocol error code.