I have this avro schema
{
\"namespace\": \"xx.xxxx.xxxxx.xxxxx\",
\"type\": \"record\",
\"name\": \"MyPayLoad\",
\"fields\": [
{\"name\": \"filed1\"
finally i got this working. I need to give both the schemas in the SpecificDatumReader So i modified the parsing like this where i passed both the old and new schema in the reader and it worked like a charm
public static final MyPayLoad parseBinaryPayload(byte[] payload) {
DatumReader payloadReader = new SpecificDatumReader<>(SCHEMA_V1, SCHEMA_V2);
Decoder decoder = DecoderFactory.get().binaryDecoder(payload, null);
MyPayLoad myPayLoad = null;
try {
myPayLoad = payloadReader.read(null, decoder);
} catch (IOException e) {
logger.log(Level.SEVERE, e.getMessage(), e);
}
return myPayLoad;
}