almendar
almendar

Reputation: 1813

Resolving a path in clustered Actor system

I have an hierarchy of 3 actors: SM -> R -> W SM - Service Manager R - router W - worker

SM creates the R actor that in turn created actor W which is deployed on a remote node.

Creation of Actor W takes some time because it gathers information from external services so a few seconds delay is normal. Thus in preStart() I want to send a message from W to SM that init is complete and it is fully operational.

I've tried to reach the SM actor from W this way:

val myCreatorServiceManagerActorPath = self.path.parent.parent
context.actorSelection(myCreatorServiceManagerActorPath) ! RegisteredServiceWorker(serviceName)

All of those messages goes to the deadLetter inbox. Correct me if I'm wrong but shouldn't the localization be transparent? What is the proper way of contacting the SM actor?

If it's of any help here is the dead-letter-log

monitor [INFO] [03/28/2014 11:34:49.253] [application-akka.actor.default-dispatcher-18] [akka://application/remote/akka.tcp/[email protected]:2558/user/ServiceManager] Message [pl.mlife.mcloud.runner.common.ServiceRuntimeActor$RegisteredServiceWorker] from Actor[akka://application/remote/akka.tcp/[email protected]:2558/user/ServiceManager/sample/c3#-1356554194] to Actor[akka://application/remote/akka.tcp/[email protected]:2558/user/ServiceManager] was not delivered. [3] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.

Upvotes: 1

Views: 402

Answers (1)

sourcedelica
sourcedelica

Reputation: 24040

Have R pass SM to W in its constructor. Then send directly to W without needing to use actorSelection.

Upvotes: 1

Related Questions