Choose Representation for Avro Schema Logical Type in Java

57 views Asked by At

I have this Avro schema

{
  "name": "SimpleEvent",
  "type": "record",
  "fields": [
    {
      "name": "timestamp",
      "type": {
        "type": "long",
        "logicalType": "timestamp-millis"
      }
    }
  ]
}

The compiled JAVA class uses java.time.Instant to populate the timestamp field. I want to populate it with org.joda.time.Instant for different reasons.

I couldn't find any documentation about it.

Is it possible? And how?

Using:

  • Maven, avro-maven-plugin v1.11.0
  • Apache Avro v1.11.3
  • Java 11
0

There are 0 answers