protected String renderAvroMessage(AvroSchemaStore store, Record record) { if (store == null || !isAvroMessage(record.getData())) { throw new IllegalArgumentException("Not avro encoded"); } long fp = getFingerPrint(record.getData()); Schema schema = store.findByFingerprint(fp); if (schema == null) { throw new IllegalStateException(String.format("Not found schema: 0x%08X", fp)); } GenericData genericData = new GenericData(); BinaryMessageDecoder<GenericRecord> decoder = new BinaryMessageDecoder<>(genericData, schema); try { GenericRecord avroRecord = decoder.decode(record.getData(), null); return avroRecord.toString(); } catch (IOException e) { throw new IllegalStateException( String.format("Error: %s decoding with schema: 0x%08X", e.getMessage(), fp)); } }