Currently, the Java Adapter only provides GenericProducers that accept IndexedRecords (most generic AVRO class). For IAdapterCallback interface implementations this holds as well: only IndexRecords are pushed to the callback implementations.
This means that the AVRO objects always need to be casted upon receiving, and that incorrect AVRO objects (that dont correspond to the used schema) can be provided to the producers.
It would be valuable / safe to also have a specific callback interface: that already casts the received records to the correct class. And a specific producer, that only accepts AVRO classes of the corresponding topic.
Currently, the Java Adapter only provides GenericProducers that accept IndexedRecords (most generic AVRO class). For IAdapterCallback interface implementations this holds as well: only IndexRecords are pushed to the callback implementations.
This means that the AVRO objects always need to be casted upon receiving, and that incorrect AVRO objects (that dont correspond to the used schema) can be provided to the producers.
It would be valuable / safe to also have a specific callback interface: that already casts the received records to the correct class. And a specific producer, that only accepts AVRO classes of the corresponding topic.