code-not-found / spring-kafka

spring-kafka projects
https://www.codenotfound.com/spring-kafka
MIT License
229 stars 419 forks source link

Getting ClassCast Exception : GenericData$Record cannot be cast to org.apache.avro.specific.SpecificRecordBase #5

Open ghost opened 6 years ago

ghost commented 6 years ago

While using the given AvroSerializer and Deserializer in Serde with Kafka streams , I am facing ClassCastException GenericData$Record cannot be cast to org.apache.avro.specific.SpecificRecordBase.

config.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.serdeFrom(new AvroSerializer() , new AvroDeserializer(MemberMeasureKey.class)).getClass()); config.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.serdeFrom(new AvroSerializer() , new AvroDeserializer(MemberMeasureValue.class)).getClass());

Please help me on this.

ShiyangHuang commented 5 years ago

Same Issue