Skip to content

Instantly share code, notes, and snippets.

@talfco
Created May 26, 2020 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talfco/687bb7421e11b6898c0bbc1686ac7208 to your computer and use it in GitHub Desktop.
Save talfco/687bb7421e11b6898c0bbc1686ac7208 to your computer and use it in GitHub Desktop.
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