Skip to content

Commit

Permalink
With automatic schema manipulation, do not upload own schema
Browse files Browse the repository at this point in the history
  • Loading branch information
blootsvoets committed Oct 29, 2018
1 parent 5f6cf6d commit 288acf2
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,19 +166,14 @@ public void addSchemaMetadata(String topic, boolean ofValue, ParsedSchemaMetadat
*/
public ParsedSchemaMetadata getOrSetSchemaMetadata(String topic, boolean ofValue, Schema schema,
int version) throws IOException {
ParsedSchemaMetadata metadata;
try {
metadata = getSchemaMetadata(topic, ofValue, version);
if (metadata.getSchema().equals(schema)) {
return metadata;
}
return getSchemaMetadata(topic, ofValue, version);
} catch (IOException ex) {
logger.warn("Schema for {} value was not yet added to the schema registry.", topic);
ParsedSchemaMetadata metadata = new ParsedSchemaMetadata(null, null, schema);
addSchemaMetadata(topic, ofValue, metadata);
return metadata;
}

metadata = new ParsedSchemaMetadata(null, null, schema);
addSchemaMetadata(topic, ofValue, metadata);
return metadata;
}

private class SchemaRequestBody extends RequestBody {
Expand Down

0 comments on commit 288acf2

Please sign in to comment.