Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
statefun-3.1.0
Description
When using RequestReplyFunctionBuilder to build a stateful functions job, the job fails at runtime with:
Java 8 date/time type `java.time.Duration` not supported by default: add Module "org.apache.flink.shaded.jackson2.com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling
It appears this is because, in RequestReplyFunctionBuilder::transportClientPropertiesAsObjectNode, a default instance of ObjectMapper is used to serialize the client properties, which now include a java.time.Duration. There is a StateFunObjectMapper class in the project that has customized serde support, but it is not used here.
The fix seems to be to:
- Use an instance of StateFunObjectMapper to serialize the client properties in RequestReplyFunctionBuilder
- Modify StateFunObjectMapper to both serialize and deserialize instances of java.time.Duration (currently, only deserialization is supported)
I've made these changes locally and it seems to fix the problem. Would you be interested in a PR? Thanks.
Attachments
Issue Links
- links to