2.2 Spotlight: actorSelection instead of actorFor

actorFor is deprecated in favor of actorSelection because actor references acquired with actorFor behave differently for local and remote actors.

Take for example an actor which is terminated and created again under the same path. Sending to local references of the previous incarnation of the actor will not be delivered to the new incarnation, but the opposite was the case for remote references. The reason was that the target actor was looked up by its path on every message delivery and the path didn’t distinguish between the two incarnations of the actor.

For bootstrapping remote references or when the exact incarnation of the actor is irrelevant you should use actorSelection.

Read more in the migration guide.

Recent comments

Blog comments powered by Disqus