public static String getAvroSchemaFromHeader ( Record record , String headerName ) throws DataGeneratorException { String jsonSchema = record . getHeader ( ) . getAttribute ( headerName ) ; if ( jsonSchema == null || jsonSchema . isEmpty ( ) ) { throw new DataGeneratorException ( Errors . AVRO_GENERATOR_03 , record . getHeader ( ) . getSourceId ( ) ) ; } return jsonSchema ; }
Retrieves avro schema from given header . Throws an exception if the header is missing or is empty .