You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What am I trying to do?
We are using Apache Flink which requires all classes (user-defined functions) and their members to be serializable. I'm trying to decorate all the functions with a Retry.of(Function<I, O>) and subscribe to its events.
The Problem
The Function decorated with Retry.decorateFunction(Retry, Function) is a class-level field to avoid duplicate subscriptions to events.
The flink program fails to bootstrap because the class-level field Function is not serializable. This is because the Retry.decorateFunction(Retry, Function) captures the Retry param(see this).
While the configuration classes are marked serializable (thanks to #1046), the corresponding interfaces like Retry and their implementations like RetryImpl are still not serializable.
Current Workaround
To overcome this, I have to mark the decorated function as transient and specify deserialization behavior by overriding the readObject(ObjectInputStream).
Resilience4j version: 1.7.1
Java version: 1.11
What am I trying to do?
We are using
Apache Flink
which requires all classes (user-defined functions) and their members to be serializable. I'm trying to decorate all the functions with aRetry.of(Function<I, O>)
and subscribe to its events.The Problem
The
Function
decorated withRetry.decorateFunction(Retry, Function)
is a class-level field to avoid duplicate subscriptions to events.The flink program fails to bootstrap because the class-level field
Function
is not serializable. This is because theRetry.decorateFunction(Retry, Function)
captures theRetry
param(see this).While the configuration classes are marked serializable (thanks to #1046), the corresponding interfaces like
Retry
and their implementations likeRetryImpl
are still not serializable.Current Workaround
To overcome this, I have to mark the decorated function as
transient
and specify deserialization behavior by overriding thereadObject(ObjectInputStream).
Proposed Solution
Mark the interfaces as serializable so that all the implementations are serializable by default.
The text was updated successfully, but these errors were encountered: