Are there any advantages or disadvantages for using JsonDeserializer in kafka consumer over manually parsing received JSON String using Jackson inside the application?
Will be there any kind of impacts in performance etc?
advantages
Less code for you to write.
There should be no performance impacts since the deserializer is doing exactly the same thing that your code would be.
It will be decoded directly from the byte[]
. If you use a StringDeserializer
and decode it yourself, there would be an unnecessary byte[]->String
conversion.
If you want to do it yourself for some reason, better to use a ByteArrayDeserializer
and consume it as a byte[]
.