Java types and mapping of avro types #5065
Unanswered
cagalmarini
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm working on some proof of concept involving Apicurio, Avro and Kafka, using Java
Lets suppose I have a POJO which contains a Date field that are being sent to Kafka as Avro.
When those objects get automatically registered on apicurio because of apicurio.registry.auto-register being true those schemas are effectively created but the Date member is mapped as java.util.Date instead of "type": {"type": "int", "logicalType": "date"}.
POJO:
Registered schema:
Kafka producer configuration:
Records are succesfully produced against Kafka but consuming them throws an exception:
By the way, if I use the avro maven plugin to generate Java classes based on a schema file on disk that class is created using LocalDate as member type for schema fields that are logical type date.
Example schema on disk:
Class piece of code generated:
Any ideas about how to solve this issue?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions