Skip to content
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

Constraints on using Customizable Namespace Mapping #186

Open
rsitze-mmai opened this issue Nov 15, 2023 · 3 comments
Open

Constraints on using Customizable Namespace Mapping #186

rsitze-mmai opened this issue Nov 15, 2023 · 3 comments

Comments

@rsitze-mmai
Copy link

These seem to work fine with a Kafka Producer, not so well for a Kafka Consumer: the confluent KafkaAvroDeserializer is looking for (package name, class name) matching the names in the Schema - which aren't there.

I'm not finding any clear/specific documentation for that tooling that would bridge the customized namespaces into that world. This is all new to me, so at the least, a pointer in the README to where to go next? Perhaps this just doesn't work?

@julianpeeters
Copy link
Owner

thanks for the report

Perhaps this just doesn't work?

unknown. possibly running into warning 1. if I were in your shoes, I might lean towards generating regular java classes (using sbt-avro or avro-tools), which are expected to be fully compatible with the avro ecosystem.

otherwise, if you were determined to investigate and/or get this to work, I'd accept a fix or ideas for integration tests could go here

@rsitze-mmai
Copy link
Author

Warning 1 (private fields) isn't the immediate problem - I think it really is as simple as the runtime deserializer uses the schema namespace + schema's record name as package + class name, and can't find it. That was pretty much the error I was getting anyway.

On the second point, I don't see how this can be fixed. I did look at the deserializer properties / options, and nothing really jumps out to me screaming "use THIS to map a schema type to a fully qualified classname". I poked around the code a bit, but I'm just not familiar with all the in/outs of the confluence apis/implementation.

To be clear - the consumer works just fine as long as I don't customize the namespace mapping - and that's good enough for me - so Thank You for avrohugger.

At this point, a simple statement on namespace mappings might be added: "Namespace mappings work for with KafkaAvroSerializer but not for KafkaAvroDeserializer; if anyone knows how to configure the deserializer to map incoming schema names to target class names please speak up!"

@julianpeeters
Copy link
Owner

"Namespace mappings work for with KafkaAvroSerializer but not for KafkaAvroDeserializer; if anyone knows how to configure the deserializer to map incoming schema names to target class names please speak up!"

good stuff, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants