Date Deserialization probleme

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Date Deserialization probleme

Aissa Elaffani
Hello guys,
I want to deserialize a kafka message in JSON format to a POJO, using Jackso mapper, and I am having a problem deserializing the date item in the json message. I am going to show you my date pattern format, and what i got as result! I hope someone can help me ! Please.
problemDeserialization.JPG
dateFormat.JPG
Thank you !
Reply | Threaded
Open this post in threaded view
|

Re: Date Deserialization probleme

Guowei Ma
Hi,
Maybe I miss something. But I do not get where the problem is. Could you just clarify which part of your result is not expected?
Best,
Guowei


Aissa Elaffani <[hidden email]> 于2020年6月26日周五 上午6:58写道:
Hello guys,
I want to deserialize a kafka message in JSON format to a POJO, using Jackso mapper, and I am having a problem deserializing the date item in the json message. I am going to show you my date pattern format, and what i got as result! I hope someone can help me ! Please.
problemDeserialization.JPG
dateFormat.JPG
Thank you !
Reply | Threaded
Open this post in threaded view
|

Re: Date Deserialization probleme

Marco Villalobos-2
In reply to this post by Aissa Elaffani
Hello Aisssa,

SimpleDateFormat, and java.util.Date are obsolete since JDK 1.8. 

Also, it can quite dangerous to use a class like SimpleDateFormat in a distributed system because it is not thread-safe.

one of the date and time classes in the java.time package. But you should't actually have to do any form of parsing date and time because Jackson
should do it for you if configured correctly.

You'll have to configure Jackson to use these the java.time package as instructed here:



On Thu, Jun 25, 2020 at 3:58 PM Aissa Elaffani <[hidden email]> wrote:
Hello guys,
I want to deserialize a kafka message in JSON format to a POJO, using Jackso mapper, and I am having a problem deserializing the date item in the json message. I am going to show you my date pattern format, and what i got as result! I hope someone can help me ! Please.
problemDeserialization.JPG
dateFormat.JPG
Thank you !