sijie commented on pull request #9614: URL: https://github.com/apache/pulsar/pull/9614#issuecomment-784921400
@eolivelli I shared the same question with @codelipenghui. Why can't you use a code snippet like the below? ``` Record<GenericRecord> record = ....; GenericRecord value = record.getValue(); SchemaInfo schemaInfo = record.getSchema().getSchemaInfo(); SchemaType type = schemaInfo.getType(); if (SchemaTye.AVRO == avro) { // the record is an AVRO record org.apache.avro.generic.GenericRecord avroRecord = ((GenericAvroRecord) value).getAvroRecord(); handleAvroRecord(avro); } else if (SchemaType.JSON == avro) { // the record is a JSON record JsonNode jsonRecord = ((GenericJsonRecord) value).getJsonNode(); handleJsonRecord(jsonRecord); } else if (SchemaType....) { ... } ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org