How to Deserialising Kafka AVRO messages using Apache Beam

后端 未结 5 2089
一生所求
一生所求 2021-01-15 03:16

The main goal is the aggregate two Kafka topics, one compacted slow moving data and the other fast moving data which is received every second.

I have been able to c

5条回答
  •  别那么骄傲
    2021-01-15 03:50

    Yohei's answer is good, but I also found this to work

    import io.confluent.kafka.streams.serdes.avro.SpecificAvroDeserializer;
    
    ...
    
    public static class CustomKafkaAvroDeserializer extends SpecificAvroDeserializer {}
    
    ...
    .withValueDeserializerAndCoder(CustomKafkaAvroDeserializer.class, AvroCoder.of(MyCustomClass.class))
    ...
    

    where MyCustomClass is code gen'd with Avro tools.

提交回复
热议问题