Avro Marshallers for Date and Timestamp
See original GitHub issueIt’d be handy to have frees-rpc
providing optional marshallers for serializing and deserializing dates, with no reference to a particular time zone or time of day.
Avro specs: https://avro.apache.org/docs/current/spec.html#Date
Initially, we could support:
Date
The
date
logical type represents a date within the calendar, with no reference to a particular time zone or time of day.
Timestamp (millisecond precision)
The
timestamp-millis
logical type represents an instant on the global timeline, independent of a particular time zone or calendar, with a precision of one millisecond.
As we need to take into account Java 1.7
, we could create two new different sbt modules (artifacts):
frees-rpc-marshallers-jodatime
:Java 1.7
users could include this one to serialize/deserialize dates based on:- Avro
date
: it can be managed by org.joda.time.LocalDate. - Avro
timestamp-millis
: it can be managed by org.joda.time.LocalDateTime.
- Avro
frees-rpc-marshallers-javatime
:Java +1.8
users could include this one to serialize/deserialize dates based on- Avro
date
: it can be managed by java.time.LocalDate. - Avro
timestamp-millis
: it can be managed by java.time.LocalDateTime.
- Avro
These two new modules can be placed at modules/marshallers/jodatime
and modules/marshallers/javatime
, respectively.
Internally, as part of the serialization/deserialization process, we can use Long
as intermediate bytes representation.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (9 by maintainers)
IMO it’s completed
@fedefernandez @AntonioMateoGomez Do we need to do something else to complete this story? I think it might be completed after https://github.com/frees-io/freestyle-rpc/pull/373 and https://github.com/frees-io/freestyle-rpc/pull/374.