Open lsegv opened 1 month ago
The problem is the deserializer used with kafka, if i directly do this in a single file writing to a bytebuffer and parsing back there wont be any issue. To reproduce this you dont really need any of the code in the original post just use a union wrapper type in any of the kafka examples and try to read the payload from consumer.
Any help is greatly appreciated. I couldnt find anything to try from docs, only "apicurio.registry.use-specific-avro-reader" which helped me use specific types instead of generic but unions don't work and i'm out of ideas.
to compile the schemas i used avro-tools-1.11.1.jar (maybe its too old but why would deserialization work fine without kafka, and fail when i let kafka be the transport)...
I'm trying to simulate usecase of sending around messages in a wrapper type such that if needed devs can use multiple messages on a single topic.
Here is the type. The purpose here is to be able to pass around different messages, list or map of different types (thus avoid creating bunch of temporary wrappers and polluting namespace.
The yaml looks like this.
here is the producer
and the consumer (using kotlin here but its pretty much identical to java version in examples), only difference is i had to add
props.putIfAbsent("apicurio.registry.use-specific-avro-reader", true)
.Running this and publishing some messages i get
org.apache.avro.SchemaParseException: Undefined name: "T1"
when attempting to parse it from consumer.If i simply replace MSG and directly write any of the specific non wrapper types like T1 and read it directly there will be no issue. Is there something i'm missing? are unions problematic here? (both producer and consumer have exact same version of the schema...)