Issue with Custom DurableStore in Akka Cluster: Deserialization Error for DurableDataEnvelope
I’m working on a custom DurableStore implementation in Akka Cluster using Java. My goal is to persist Akka’s Distributed Data (ddata) using a custom logic that serializes the data and stores it in a file.
Deserialization Logic:
However, when I try to deserialize the data, I encounter the following error:
java.io.NotSerializableException: Unimplemented deserialization of message with manifest [akka.cluster.ddata.DurableStore$DurableDataEnvelope] in [akka.cluster.ddata.protobuf.ReplicatorMessageSerializer]
I have configured the serializer binding for DurableDataEnvelope as shown above. Despite that, it seems that deserialization is not correctly implemented or there’s something I’m missing.
Question:
What could be causing this deserialization issue, and how can I resolve it? Is there a specific step I’m missing when configuring or handling the deserialization for DurableDataEnvelope?
The problem is that the serializer works with string based manifests and not class names.
You can extract the manifest using akka.serialization.Serializers#manifestFor on the serialization side, the serializer id by looking up the serializer for the object akka.serialization.Serialization#findSerializerFor and call identifier on that, store all three values in your file and then use them to call akka.serialization.Serialization#deserialize(byte[], int, String) when deserializing
Ensure your custom serializer for DurableDataEnvelope is correctly implemented and configured in Akka, and that CustomDurableStore properly handles deserialization for the envelope.