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 define deployment path in the configuration.
From Akka docs:
You can retrieve arbitrary information from the
Config
object contained in theActorSystem
(or you could parse external sources withConfigFactory
yourself):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.):