Created
May 26, 2020 20:16
-
-
Save talfco/e46427f346679829f04e735162a3c398 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String persist(byte[] msg, String index, String type, String id) throws IOException { | |
if (checkForAvroSingleObjectEncoding(msg)) { | |
String jsonDoc = convertAvroBinaryToJSON(msg); | |
esPersistencyManager.createUpdateDocument(index,type,jsonDoc,id); | |
return jsonDoc; | |
} | |
else { | |
logger.error("Received message wasn't Avro Single Object encoded"); | |
throw new IOException("Received message wasn't Avro Single Object encoded"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment