When using Akka 2.0, Is there a way to get an ActorRef to a remote actor but have the address of the actor I am looking up come from configuration instead of specifying it programatically? I want to, for instance use
AkkaSystem("mysystem").actorFor("akka://system@remotehost/user/whatever")
but I want to be able to change remotehost just by changing my
application.conf.
You can retrieve arbitrary information from the
Configobject contained in theActorSystem(or you could parse external sources withConfigFactoryyourself):together with defining some string in the configuration at the path given above. You can then also use the power of the Config library to piece together the path (e.g. factor out the remote node’s address etc.):