JSON serialization differences from HLRC to new Java API Client

With the HLRC, the timestamp field below is serialized as "2023-08-10T18:59:59.143Z". However, with the new Java API Client it is serialized as a long time. This is with the new BulkIngester. Is there a way to customize the serialization to write the date as a string and include the time zone as previously? Thanks.

Map<String,Object> data = new HashMap<>();
data.put("timestamp", new Date());
IndexRequest request = new IndexRequest(index);
request.source(data);

The Java API client uses an object mapper (typically Jackson) to serialize values. You should configure it so that it uses this format.

This article explains various way to achieve that: https://www.baeldung.com/jackson-serialize-dates

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.