I integrate Akka and Spark usage as follows: when a task is distributed among Spark nodes when processing these tasks, each node also periodically sends indicator data to another data collection process, which is located somewhere else on the network using Akka (connecting to the remote process via akka-remote).
The actorβs send / receive metrics functionality works very well when used offline, but when it is integrated into the Spark task, the following error occurs:
java.lang.IllegalStateException: Trying to deserialize a serialized ActorRef without an ActorSystem in scope. Use 'akka.serialization.Serialization.currentSystem.withValue(system) { ... }' at akka.actor.SerializedActorRef.readResolve(ActorRef.scala:407) ~[akka-actor_2.10-2.3.11.jar:na]
If I understood correctly, the source of the problem is the Spark node, which is unable to deserialize ActorRef, because it does not have the complete information necessary for this. I understand that installing ActorSystem in the scope will fix it, but I'm not sure how to use the suggested akka.serialization.Serialization.currentSystem.withValue(system) { ... }
Akka white papers are very good with regard to all the topics that they touch. Unfortunately, the chapter on Serialization can be improved IMHO.
Note: there is a similar SO question here, but the decision made is too specific and therefore not very useful in the general case
source share