Hi,

We are using Akka with Java API, integrated with Spring Framework (each 
actor is Prototype scope Spring bean)
There is no problem to create local actors, using 
Akka IndirectActorProducer (we use approach, described here 
<https://www.linkedin.com/pulse/spring-boot-akka-part-1-aliaksandr-liakh>)

But now we are trying to use Cluster aware router with Pool of Remote 
Deployed Routees, and there is a problem - as far as I understand Akka 
sends serialized Props to the remote node when we define a router like this:

@Bean
public ActorRef processorRouter() {
    return system.actorOf(
            new ClusterRouterPool(new RoundRobinPool(100),
                    new ClusterRouterPoolSettings(1000, 100,
                            true, 
"processor")).props(SpringExtension.SpringExtProvider.get(system).props(ProcessorActor.class)));
}


Here is a serialization exception:

akka.remote.MessageSerializer$SerializationException: Failed to serialize 
remote message [class akka.remote.DaemonMsgCreate] using serializer [class 
akka.remote.serialization.DaemonMsgCreateSerializer].
at akka.remote.MessageSerializer$.serialize(MessageSerializer.scala:61) 
~[akka-remote_2.11-2.4.17.jar!/:na]
at 
akka.remote.EndpointWriter$$anonfun$serializeMessage$1.apply(Endpoint.scala:895)
 
~[akka-remote_2.11-2.4.17.jar!/:na]
at 
akka.remote.EndpointWriter$$anonfun$serializeMessage$1.apply(Endpoint.scala:895)
 
~[akka-remote_2.11-2.4.17.jar!/:na]
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:58) 
~[scala-library-2.11.8.jar!/:na]
at akka.remote.EndpointWriter.serializeMessage(Endpoint.scala:894) 
~[akka-remote_2.11-2.4.17.jar!/:na]
at akka.remote.EndpointWriter.writeSend(Endpoint.scala:786) 
~[akka-remote_2.11-2.4.17.jar!/:na]
at akka.remote.EndpointWriter$$anonfun$4.applyOrElse(Endpoint.scala:761) 
~[akka-remote_2.11-2.4.17.jar!/:na]
at akka.actor.Actor$class.aroundReceive(Actor.scala:497) 
~[akka-actor_2.11-2.4.17.jar!/:na]
at akka.remote.EndpointActor.aroundReceive(Endpoint.scala:452) 
~[akka-remote_2.11-2.4.17.jar!/:na]
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526) 
[akka-actor_2.11-2.4.17.jar!/:na]
at akka.actor.ActorCell.invoke(ActorCell.scala:495) 
[akka-actor_2.11-2.4.17.jar!/:na]
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257) 
[akka-actor_2.11-2.4.17.jar!/:na]
at akka.dispatch.Mailbox.run(Mailbox.scala:224) 
[akka-actor_2.11-2.4.17.jar!/:na]
at akka.dispatch.Mailbox.exec(Mailbox.scala:234) 
[akka-actor_2.11-2.4.17.jar!/:na]
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) 
[scala-library-2.11.8.jar!/:na]
at 
scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
 
[scala-library-2.11.8.jar!/:na]
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) 
[scala-library-2.11.8.jar!/:na]
at 
scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
 
[scala-library-2.11.8.jar!/:na]
 Caused by: java.io.NotSerializableException: No configured 
serialization-bindings for class 
[org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext]
at akka.serialization.Serialization.serializerFor(Serialization.scala:235) 
~[akka-actor_2.11-2.4.17.jar!/:na]
at 
akka.serialization.Serialization.findSerializerFor(Serialization.scala:211) 
~[akka-actor_2.11-2.4.17.jar!/:na]
...


Actualy I'm not sure that it'll work even if there were no serialization 
error, looks like the problem is a bit more complex.
Is there a graceful way to tell remote Akka to create a pool of actors via 
IndirectActorProducer mechanism, as it works for local actors?

Thank you,
Alex

-- 
>>>>>>>>>>      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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to