Cannot send process cloud event with OffsetDateTime fields
See original GitHub issueDescribe the bug Since 1.12.0.Final my process that’s using an object with OffsetDateTime fields as process variable fails to generate kafka cloud event, representing new task creation.
Expected behavior Process should generate new task and send proper cloud event to kafka topic.
Actual behavior
There’s an exception thrown:
Error while publishing event to topic kogito-processinstances-events for event org.kie.kogito.services.event.ProcessInstanceDataEvent@62564738: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type
java.time.OffsetDateTime not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling (through reference chain: org.kie.kogito.services.event.ProcessInstanceDataEvent["data"]->org.kie.kogito.services.event.impl.ProcessInstanceEventBody["variables"]->java.util.Collections$UnmodifiableMap["executionDates"]->com.orange.swing.microservices.process.TaskDates["startDate"])
Adding jackson-datatype-jsr310 nor quarkus-jackson doesn’t help. Problem doesn’t exist in 1.11.3.Final.
To Reproduce
Link to a small reproducer (preferably a Maven project if the issue is not Gradle-specific). https://github.com/jgrabowski/quarkus-bugs
Or attach an archive containing the reproducer to the issue.
Steps to reproduce the behavior:
- launch kafka on 9092 port (e.g.
docker run --rm -p 2181:2181 -p 9092:9092 -e ADVERTISED_HOST=172.17.0.1 -e NUM_PARTITIONS=1 --name kafka johnnypark/kafka-zookeeper
) mvn clean compile quarkus:dev
curl -X POST "http://localhost:8082/DateProblem" -H "accept: */*" -H "Content-Type: application/json" -d "{\"testDate\":\"2021-03-04T16:55:46.453Z\"}"
Configuration In attached project
Environment (please complete the following information): OpenJDK Runtime Environment (build 11.0.10+9-Ubuntu-0ubuntu1.20.04)
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
I’ve tried to register JavaTimeModule via ObjectMapperCustomizer but it doesn’t seem to work.
Shall we move this issue to https://github.com/kiegroup/kogito-runtimes?