From 288acf239055f8177eaa91a3624e435b569beb73 Mon Sep 17 00:00:00 2001 From: Joris Borgdorff Date: Mon, 29 Oct 2018 14:15:10 +0100 Subject: [PATCH] With automatic schema manipulation, do not upload own schema --- .../org/radarcns/producer/rest/SchemaRetriever.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/radar-commons/src/main/java/org/radarcns/producer/rest/SchemaRetriever.java b/radar-commons/src/main/java/org/radarcns/producer/rest/SchemaRetriever.java index 8fcaf32e..1a4b421b 100644 --- a/radar-commons/src/main/java/org/radarcns/producer/rest/SchemaRetriever.java +++ b/radar-commons/src/main/java/org/radarcns/producer/rest/SchemaRetriever.java @@ -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 {