Thanks Martynas, I was afraid that this was the case. I would prefer to view actor paths as i.e. endpoints of a service, same path same service. I might serialize thousands of actorrefs and I suppose actorSelection for all those will take time as it requires network communication.

So it is not really a serialization issue. It is rather an actor restart issue using actorOf() because it gets a new UID. In my cluster I have thousands of actors and those are cached (in memory or serialized - it doesn't matter) on each server. If one of the cluster members goes down and restarts, then the ActorRef cache is not valid. This makes me thing that I either should cache the paths instead but then actorSelection will take more time than just actorRef ! X , or not cache anything at all - that will complicate the impl and network overhead considerably .



On 05/11/15 15:41, Martynas Mickevičius wrote:
Hi Kostas,

serialized ActorRef contain UID which indicates an incarnation <http://doc.akka.io/docs/akka/2.4.0/scala/actors.html#Actor_Lifecycle> of particular actor.

res8: akka.actor.ActorRef = Actor[akka://repl/user/$a#1452319393]

When you restart your actor system newly created actors have the same path but they have a different UID and a message sent to such deserialized ActorRef ends up in dead letters.

What you have to do is to resolve these new UIDs that have been assigned to new actors. You can do that, as you correctly hinted to, by using actor selection.

val f: Future[ActorRef] = system.actorSelection(oldRef.path).resolveOne

On Thu, Nov 5, 2015 at 4:02 PM, Kostas kougios <[email protected] <mailto:[email protected]>> wrote:

    I could ofcourse do an actorSelection but is there an easier way?
-- >>>>>>>>>> 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]
    <mailto:[email protected]>.
    To post to this group, send email to [email protected]
    <mailto:[email protected]>.
    Visit this group at http://groups.google.com/group/akka-user.
    For more options, visit https://groups.google.com/d/optout.




--
Martynas Mickevičius
Typesafe <http://typesafe.com/> – Reactive <http://www.reactivemanifesto.org/> Apps on the JVM
--
>>>>>>>>>> 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 a topic in the Google Groups "Akka User List" group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/akka-user/n8HlIIkZhCs/unsubscribe. To unsubscribe from this group and all its topics, send an email to [email protected] <mailto:[email protected]>. To post to this group, send email to [email protected] <mailto:[email protected]>.
Visit this group at http://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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to