Note that the intention is to use the local `Replicator` so there is not
much point in delegating the message with a router to remote node, unless
you use nodes with different roles, such as "frontend" and "backend" and
only run distributed data on the "backend" nodes and want to send the
messages from the "frontend" to the "backend" with the routers. That is
probably what you are trying to do and then you must have serialization for
that message.

/Patrik

On Wed, Jun 7, 2017 at 1:33 PM, Akka Team <[email protected]> wrote:

> The error message says that you have not configured serialization for the
> message sample.distributeddata.ReplicatedCache.PutInCache which something
> tries to send between nodes.
>
> --
> Johan
> Akka Team
>
> On Tue, May 30, 2017 at 10:37 PM, Mainak Ghosh <[email protected]>
> wrote:
>
>> Hello,
>>
>> I am recently playing around with cluster aware routers and distributed
>> data and I have a few questions. I extended the multi jvm test code
>> ReplicatedCacheSpec to create a cluster aware router which creates a pool
>> of ReplicatedCache worker routees. Here is the code:
>> https://gist.github.com/mghosh4/55f96a7402960923c528ea69a103c5af
>>
>> When I try running this code: I get the following exception:
>>
>> Failed to serialize remote message [class akka.actor.ActorSelectionMessage]
>> using serializer [class 
>> akka.remote.serialization.MessageContainerSerializer].
>> Transient association error (association remains live)
>> [JVM-1]         at akka.remote.MessageSerializer$
>> .serialize(MessageSerializer.scala:62)
>> [JVM-1]         at akka.remote.EndpointWriter.$an
>> onfun$serializeMessage$1(Endpoint.scala:895)
>> [JVM-1]         at scala.util.DynamicVariable.wit
>> hValue(DynamicVariable.scala:58)
>> [JVM-1]         at akka.remote.EndpointWriter.ser
>> ializeMessage(Endpoint.scala:895)
>> [JVM-1]         at akka.remote.EndpointWriter.wri
>> teSend(Endpoint.scala:786)
>> [JVM-1]         at akka.remote.EndpointWriter$$an
>> onfun$4.applyOrElse(Endpoint.scala:761)
>> [JVM-1]         at akka.actor.Actor.aroundReceive(Actor.scala:513)
>> [JVM-1]         at akka.actor.Actor.aroundReceive$(Actor.scala:511)
>> [JVM-1]         at akka.remote.EndpointActor.arou
>> ndReceive(Endpoint.scala:452)
>> [JVM-1]         at akka.actor.ActorCell.receiveMe
>> ssage(ActorCell.scala:519)
>> [JVM-1]         at akka.actor.ActorCell.invoke(ActorCell.scala:488)
>> [JVM-1]         at akka.dispatch.Mailbox.processM
>> ailbox(Mailbox.scala:257)
>> [JVM-1]         at akka.dispatch.Mailbox.run(Mailbox.scala:224)
>> [JVM-1]         at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
>> [JVM-1]         at akka.dispatch.forkjoin.ForkJoi
>> nTask.doExec(ForkJoinTask.java:260)
>> [JVM-1]         at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(
>> ForkJoinPool.java:1339)
>> [JVM-1]         at akka.dispatch.forkjoin.ForkJoi
>> nPool.runWorker(ForkJoinPool.java:1979)
>> [JVM-1]         at akka.dispatch.forkjoin.ForkJoi
>> nWorkerThread.run(ForkJoinWorkerThread.java:107)
>> [JVM-1] Caused by: java.io.NotSerializableException: No configured
>> serialization-bindings for class [sample.distributeddata.Replic
>> atedCache$PutInCache]
>> [JVM-1]         at akka.serialization.Serializati
>> on.serializerFor(Serialization.scala:235)
>> [JVM-1]         at akka.serialization.Serializati
>> on.findSerializerFor(Serialization.scala:211)
>> [JVM-1]         at akka.remote.serialization.Mess
>> ageContainerSerializer.serializeSelection(MessageContainerSe
>> rializer.scala:35)
>>
>> When I change line 83 in the gist from
>>
>> context.actorOf(FromConfig.props(ReplicatedCache.props()), name = "
>> replicatedCache")
>>
>> to
>>
>> context.actorOf(ReplicatedCache.props), name = "replicatedCache")
>>
>> this error goes away. Is there something that I do not understand?
>>
>> Finally, I tried adding a resizer block in the configuration. I saw an
>> exception saying something like resizer and cluster block cannot work
>> together. Is that a current limitation?
>>
>> Thanks,
>> Mainak
>>
>> --
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/c
>> urrent/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 [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> >>>>>>>>>> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Patrik Nordwall
Akka Tech Lead
Lightbend <http://www.lightbend.com/> -  Reactive apps on the JVM
Twitter: @patriknw

-- 
>>>>>>>>>>      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 [email protected].
To post to this group, send email to [email protected].
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