Support for Microsoft's JSON date formats
mubeta06 opened this issue · 2 comments
I am working with an Odata API interface which presents timestamp values such as lastModified in a format similar to `//Date(1530144000000+0530)/. Would it be possible to get such date formats supported. If this is something that could be supported I'd be happy to contribute this sort of functionality, a steer in the right direction would certainly be appreciated.
Hi @mubeta06 ,
Sure, timestamp parsing is managed by implementations of this interface:
https://github.com/castorm/kafka-connect-http/blob/master/kafka-connect-http/src/main/java/com/github/castorm/kafka/connect/http/response/timestamp/spi/TimestampParser.java
You can see a couple of examples here:
https://github.com/castorm/kafka-connect-http/blob/master/kafka-connect-http/src/main/java/com/github/castorm/kafka/connect/http/response/timestamp/EpochMillisTimestampParser.java
https://github.com/castorm/kafka-connect-http/blob/master/kafka-connect-http/src/main/java/com/github/castorm/kafka/connect/http/response/timestamp/NattyTimestampParser.java
Then it's a matter of configuring your parser:
https://github.com/castorm/kafka-connect-http#httpresponserecordtimestampparser
I hope this helps.
Thanks,
Best regards.
I forgot, you can implement and use this without contributing it to the project, but contributions are welcome!
Best regards.