0
votes

I am getting deserialization exception while consuming data from Kafka topic. I want to set the offset to current +1. I have an error handler at container level which takes exception, consumer record and consumer objects in argument. In the exception message I can see the topic, partition and offset. But consumer record is null. How can I get topic, partition and offset?

Please help.

1

1 Answers

0
votes

The error occurs before a ConsumerRecord is created.

Starting with version 2.2, you can configure the ErrorHandlingDeserializer2 to wrap the real deserializer; the container then calls the error handler with a DeserializationException and you will get a ConsumerRecord witha null value.

The exception has the original byte[] in its data property.