Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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