Repository navigation
Object Container Files and agnostic decoding
Avro messages can be self-sufficient by encoding them together with a schema. To decode them you don't need to know anything about the message.
Now it will be possible to decode them ether via new agnostic Avrora.decode/1 or old Avrora.decode/2, check it out:
message = <<79, 98, 106, 1, 3, 204, 2, 20, 97, 118, 114, 111, 46, 99, 111, 100, 101, 99, 8, 110, 117,108, 108, 22, 97, 118, 114, 111, 46, 115, 99, 104, 101, 109, 97, 144, 2, 123, 34, 110, 97,109, 101, 115, 112, 97, 99, 101, 34, 58, 34, 105, 111, 46, 99, 111, 110, 102, 108, 117, 101,110, 116, 34, 44, 34, 110, 97, 109, 101, 34, 58, 34, 80, 97, 121, 109, 101, 110, 116, 34,44, 34, 116, 121, 112, 101, 34, 58, 34, 114, 101, 99, 111, 114, 100, 34, 44, 34, 102, 105,101, 108, 100, 115, 34, 58, 91, 123, 34, 110, 97, 109, 101, 34, 58, 34, 105, 100, 34, 44,34, 116, 121, 112, 101, 34, 58, 34, 115, 116, 114, 105, 110, 103, 34, 125, 44, 123, 34, 110,97, 109, 101, 34, 58, 34, 97, 109, 111, 117, 110, 116, 34, 44, 34, 116, 121, 112, 101, 34,58, 34, 100, 111, 117, 98, 108, 101, 34, 125, 93, 125, 0, 50, 8, 86, 136, 188, 182, 153, 91,143, 129, 0, 45, 200, 112, 4, 192, 2, 90, 72, 48, 48, 48, 48, 48, 48, 48, 48, 45, 48, 48,48, 48, 45, 48, 48, 48, 48, 45, 48, 48, 48, 48, 45, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,48, 48, 123, 20, 174, 71, 225, 250, 47, 64, 50, 8, 86, 136, 188, 182, 153, 91, 143, 129, 0,45, 200, 112, 4, 192>>
Avrora.decode(message)
{:ok, [%{"amount" => 15.99, "id" => "00000000-0000-0000-0000-000000000000"}]}IMPORTANT: Please keep in mind that messages encoded with OCF are always lists.
Also new Avrora.decode/1 supports schema registry, but requires registry_url configuration to be set to non-nil value.
config :avrora,
registry_url: "http://localhost:8081", # default to `nil`Breaking changes
I'm sorry for misunderstanding the concept of Application.start/2. Auto-start of Avrora application was removed, please use manual or supervision tree instead 💔