Hi,

I have a similar problem. I am using a custom serializer for serializing a 
snapshot. (extended from akka.serialization.Serializer):

akka {
  actor {
    serializers {
        customSerializer = "com.handler.util.CustomSerializer"
    }
    serialization-bindings {
        "com.handler.common.MySnapshot" = customSerializer
    }
  }
}

For saving snapshot the processor calls:

saveSnapshot(mySnapshot)

As response the processor immediately receives a SaveSnapshotSuccess 
message.

5 seconds later in the same testcase I try to recover the processor and 
would expect to receive a SnapshotOffer - but that is not the case, instead 
I get a 

java.io.EOFException
        at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown 
Source)
        at 
java.io.ObjectInputStream$BlockDataInputStream.readUTFBody(Unknown Source)
        at java.io.ObjectInputStream$BlockDataInputStream.readUTF(Unknown 
Source)
        at java.io.ObjectInputStream.readUTF(Unknown Source)
        at java.io.ObjectStreamClass.readNonProxy(Unknown Source)
        at java.io.ObjectInputStream.readClassDescriptor(Unknown Source)
        at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
        at java.io.ObjectInputStream.readClassDesc(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.readObject(Unknown Source)
        at 
akka.serialization.JavaSerializer$$anonfun$1.apply(Serializer.scala:136)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
        at 
akka.serialization.JavaSerializer.fromBinary(Serializer.scala:136)
        at 
akka.serialization.Serialization$$anonfun$deserialize$2.apply(Serialization.scala:113)
        at scala.util.Try$.apply(Try.scala:161)
        at 
akka.serialization.Serialization.deserialize(Serialization.scala:113)
        at 
akka.persistence.serialization.SnapshotSerializer.snapshotFromBinary(SnapshotSerializer.scala:91)
        at 
akka.persistence.serialization.SnapshotSerializer.fromBinary(SnapshotSerializer.scala:55)
        at 
akka.serialization.Serialization$$anonfun$deserialize$2.apply(Serialization.scala:113)
        
The snapshot file is not empty.

Digging deeper into the problem I found out that the method fromBinary of 
my custom serializer is never being called. It seems as if the custom 
serializer is working for writing, but not for reading the snapshot.        

If I do the same thing with the same custom serializer, but with Persistent(..) 
messages instead of saveSnapshot, it works. ToBinary & fromBinary are being 
called as expected.

Is there probably an issue in the SnapshotSerializer?

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to