Strech / avrora

A convenient Elixir library to work with Avro messages, schemas and Confluent® Schema Registry
https://hexdocs.pm/avrora
MIT License
97 stars 33 forks source link

Get schema name on decode #82

Closed ricn closed 3 years ago

ricn commented 3 years ago

Hello,

Is it possible to get the schema name that was used when decoding? I can't find it in the documentation.

I'm thinking of something like this: {:ok, decoded, schema_name} = Avrora.decode(message)

Strech commented 3 years ago

Hi @ricn, I think currently when decoding schema registry encoded messages you will not be able to see the schema except maybe in the logs.

But you can use Avrora.extract_schema/1 to retrieve schema the same way you decode the message. Does it make sense to you?

ricn commented 3 years ago

Hi @Strech, Aha thanks. That's exactly what I want :+1:

Strech commented 3 years ago

You are welcome @ricn 🤝