From 825f058c90d3cf60c0c08ad73abf7b73892f893f Mon Sep 17 00:00:00 2001
From: Francisco Javier Tirado Sarti
<65240126+fjtirado@users.noreply.github.com>
Date: Wed, 21 Aug 2024 17:06:50 +0200
Subject: [PATCH] Do not serialize as timestamp (#2000)
---
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());