Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Consumer Deserializer

Sumit Rawal answered on June 1, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • Custom deserializer
  • doing our own deserialization with a custom Deserializer

  • Consumer Deserializer

    0

    As discussed earlier, Kafka producers use serializers to write objects as streams of bytes to partitions. When the consumers read records from a partition, they read a stream of bytes and need deserializers to convert the byte stream back into an object. It is imperative that the deserializer used to convert the byte streams into objects should match the serializer that initially transformed the objects into the byte stream. For instance, you can’t use a deserializer for a class Foo to deserialize a class Bar object. The developer is required to track which serializers are used to write to a topic and choose corresponding deserializers for the consumer side. Generally, it is a bad idea to spin-up your own custom serialization/deserialization classes. Instead, use any of the available open source serialization frameworks such as Avro, Thrift, Protobuf, etc. As mentioned in the Producer lesson, using Avro and the Schema Repository together can ensure that all the data written to a specific topic is compatible with the schema of the topic and can be deserialized with a matching deserializer and schema. Any compatibility errors on either the consumer or the producer side are caught easily.

    We’ll carry forward with the Car example from the Producer lesson, which had the following Avro schema. 

    Popularity 1/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Jun 01 2023
    Sumit Rawal
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.