From 425074a5bde2ec92720cc545c5c94f8d36236438 Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti Date: Mon, 19 Aug 2024 18:29:13 +0200 Subject: [PATCH] Do not serialize as timestamp --- kogito-quarkus-examples/process-performance-client/pom.xml | 4 ++++ .../org/kie/kogito/performance/client/KafkaDispatcher.java | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/kogito-quarkus-examples/process-performance-client/pom.xml b/kogito-quarkus-examples/process-performance-client/pom.xml index 28f21b8d57..45ddd48ed6 100755 --- a/kogito-quarkus-examples/process-performance-client/pom.xml +++ b/kogito-quarkus-examples/process-performance-client/pom.xml @@ -77,6 +77,10 @@ com.fasterxml.jackson.core jackson-databind + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + org.kie.kogito kogito-events-api diff --git a/kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/KafkaDispatcher.java b/kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/KafkaDispatcher.java index 119cdc3f40..0e12a697ad 100644 --- a/kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/KafkaDispatcher.java +++ b/kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/KafkaDispatcher.java @@ -31,6 +31,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; public class KafkaDispatcher implements RequestDispatcher { @@ -46,7 +47,7 @@ public ObjectCloudEvent(String trigger, Object data) { public KafkaDispatcher(String trigger) { this.trigger = trigger; - this.objectMapper = ObjectMapperFactory.get(); + this.objectMapper = ObjectMapperFactory.get().disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); Map properties = Collections.singletonMap(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092"); kafkaProducer = new KafkaProducer<>(properties, new ByteArraySerializer(), new ByteArraySerializer());