I’m migrating an application from Akka 2.5.32 to 2.6.20 and getting a JavaSerializationException
when I pass akka.actor.ReceiveTimeout
to persistAsync()
[MetricsSpec-akka.actor.default-dispatcher-5] [DisabledJavaSerializer(akka://MetricsSpec)] - Outgoing message attempted to use Java Serialization even though `akka.actor.allow-java-serialization = off` was set! Message type was: [class akka.actor.ReceiveTimeout$]
[ERROR] [MetricsSpec-akka.actor.default-dispatcher-5] [akka://MetricsSpec@127.0.0.1:64480/system/str4TestProbe-1/str1__1/str1__1] - Rejected to persist event type [akka.actor.ReceiveTimeout$] with sequence number [2] for persistenceId [/fsms/worktypes/str1__1] due to [Attempted to serialize message using Java serialization while `akka.actor.allow-java-serialization` was disabled. Check WARNING logs for more details.].
akka.serialization.DisabledJavaSerializer$JavaSerializationException: Attempted to serialize message using Java serialization while `akka.actor.allow-java-serialization` was disabled. Check WARNING logs for more details.
The serialization config for this test is
serializers {
akka-persistence-message = "akka.persistence.serialization.MessageSerializer"
akka-persistence-snapshot = "akka.persistence.serialization.SnapshotSerializer"
}
serialization-bindings {
"akka.persistence.serialization.Message" = akka-persistence-message
"akka.persistence.serialization.Snapshot" = akka-persistence-snapshot
}
Is there additional config I need to add to serialize ReceiveTimeout
since java serialization is off?
Edit: The docs say that “From Akka 2.6.0 the Akka serialization with Java serialization is disabled by default and Akka itself doesn’t use Java serialization for any of its internal messages.” so I’m confused why it’s attempting to use java serialization for an Akka message.