I'm new to Avro messaging format.
Done so far
- I've json messages
- Have created Json's avro schema, and saved that schema in .avsc file in
resourcesfolder - Created Json message based Avro data structure classes using
Avro maven plugin.
Now, Have seen so many examples online, but mostly are using schema registry for avro message schema.
Is there any reference or example where I could create avro message from Data structure (classes) created from Avro maven plugin out of .avsc file ?
Can anyone share smallest example of doing it or any reference online link ? will be really helpful.
Update:
From Avro Data structure classes, here is the schema I've got
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"group_topics_record\",\"namespace\":\"com.main.avro\",\"fields\":[{\"name\":\"urlkey\",\"type\":\"string\"},{\"name\":\"topic_name\",\"type\":\"string\"}]}");
And for example, I've string json message for which I've created above Avro schema classes, then how can I convert that into avro message (not in file, just a string) ? any code snippet ?