apache kafka – Handling large object in Avro Schema

Avro schemas are hit with the JVM limitation of 254 attributes while modelling an object.

If you have a Java object with 300 parameters, you cannot have this in one schema. Reason being, there cannot be a constructor with more than 254 parameters in Java.

Question:

I am not aware so let me ask:
In a Kafka-Avro set up, On the consumer part, when you read an object and de-serialize it, does Avro make use of the constructor ? or does it instantiate the object by some other means ?

If it uses the constructor, and if the producer sent an object with >254 attributes, reading will fail, it will error out, in my opinion.

Does it use the constructor? at all ? AVRO while reading the objects ?

I have not tried and I would like to know before I model my object.

Read more here: Source link