-
Notifications
You must be signed in to change notification settings - Fork 671
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
Adding support TopicRecordNameStrategy #1342
base: master
Are you sure you want to change the base?
Adding support TopicRecordNameStrategy #1342
Conversation
❌ Error getting contributor login(s). |
I put this PR in draft because I am looking for feedback. It would be amazing if I get it since I spent some time making TopicRecordName strategy to work |
Thanks @manuelarte . I will try to take a look, but can't promise as to when since we're in crunch time before the holidays. |
Thanks @rayokota . I completely understand. As mentioned before, I think this pr could be spit in several smaller ones to facilitate the functionality of supporting TopicRecordName strategy. |
I think it might need a few improvements. There is
Maybe, for |
I've made PR that implements a more fine grained control when serializing according to comments above: |
Thanks @ekazakas for your comment. Did you get any feedback about the serialisation hint? |
Hi @rayokota , did you guys have time to check this PR? |
None so far, it would be nice if someone could check my PRs as well. |
ok, there are a lot of changes in this PR. I will try to summarize what I changed:
avro producer topicrecordnamestrategy
andavro consumer topicrecordnamestrategy
, and they are tested against a Kotlin producer/consumer also using TopicRecordNameStrategy (https://github.com/manuelarte/kafka-kotlin-multiple-schemas-one-topic). So I tested:I am, more or less, happy on how the serialization works, but I am not so happy on how the deserialization works.
For the deserialization to work I need the fully qualified name (-), and I need to extract that from the
schemaregistry_client.SchemaInfo
, and I could not thing of a better idea now than, parsing the values and check what type of schema type is (AVRO, JSON, PROTOBUF), and then build it based on the field values.Also, because you can have more than one message, I don't use
DeserializeInto
right away, but first I retrieve the schema, then I compare that schema with the possible messages for that topicIMHO this PR is already a bit big and it's still not covering more cases like, TopicRecordName for JSON or PROTOBUF, but I think it's a good start to get feedback and possible improvements.
PS: in case this pr is too big, I could split it in several isolared steps, starting with refactoring the ConfigureSerializer method.