-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for registering schemas under custom subject #62
Comments
Hey, @arttsu thanks for rising this question. In short, I think a better manual schema registration interface definitely a thing to implement, and I would mark it as an enhancement issue. In specific auto-registration is:
WDYT, sounds good? |
@Strech, thanks for a thorough response! Glad that better manual schema registration would be on your radar. It would definitely be sufficient for my usecase. |
Just a heads-up about schema registration, this is a sneak-peek for the upcoming functionality I think it will not be exposed via the main With it, your example can be rewritten as: defp ensure_registered_schema() do
{:ok, _} = Avrora.Utils.Registrator.register_schema_by_name(@schema_full_name, as: "#{@topic_name}-value")
end |
Thanks for working on this, looks great! Very minor nitpick - have you considered using the name |
@arttsu thanks for the name suggestion, I will definitely look for the better name 👍🏼 |
@arttsu It takes me a while, but here we are https://github.com/Strech/avrora/releases/tag/v0.16.0 it includes also an updated |
Awesome! Thanks again for implementing and releasing this so quickly 👍 |
As I understand, automatic schema registration always registers schemas under subjects named after the schema's full name (namespace + schema name). However, I've encountered a need to register a schema under a subject named after a kafka topic, because of the expectations of the system we're integrating with. I think this might be a pretty common usecase, as Confluent Schema Registry specifies TopicNameStrategy as the default https://docs.confluent.io/platform/current/schema-registry/serdes-develop/index.html#subject-name-strategy.
I was able to implement a workaround in our code by manually registering the schema
but I was wondering whether there's a simpler way to do it.
avro_turf allows specifying the subject name when encoding a payload https://github.com/dasch/avro_turf/blob/master/lib/avro_turf/messaging.rb#L87. It would be very convenient if Avrora would support something like that.
PS: Thanks for your work on the library! :)
The text was updated successfully, but these errors were encountered: