When using the Produce task, we are only able to send objects with a simple structure. The current code does not handle complex types correctly, such as enums, unions, lists, maps, etc.
This commit improves handling of complex Avro types in Kafka by introducing MapToGenericRecordSerializer a better GenericRecord serialization.
Note: Further work may be required to handle fixed values (which only accept byte[]) and unions (currently using the first non-null type, which allow support for optional values but not polymorphism).
When using the
Produce
task, we are only able to send objects with a simple structure. The current code does not handle complex types correctly, such as enums, unions, lists, maps, etc.This commit improves handling of complex Avro types in Kafka by introducing
MapToGenericRecordSerializer
a betterGenericRecord
serialization.Note: Further work may be required to handle fixed values (which only accept
byte[]
) and unions (currently using the first non-null type, which allow support for optional values but not polymorphism).