First Steps with Akka Remoting
Initially, I was hopeful that setting up a simple client/server infrastructure with akka would be very easy and painless because
- akka documentation is generally very well-written and comprehensive,
- the API looks astonishingly simple.
- There are some good code samples in the akka repository.
- Don't let the links to old documentation versions misguide you! - Always check that the websites you're looking at are about the most current version of akka.
- The client seems to require a full
ActorSystem
with remoting just for calling remote actors on the server. - The client
ActorSystem
has to bind to a different port than the serverActorSystem
when running on the same box. Use different configuration sections or files. - If you try to look up a remote actor using a wrong akka url, you won't get any kind of error message. It just won't work at all.
- If you call your remote actor
serverActor
and your remote actor systemServerSystem
, and it's running onlocalhost:2554
, its url isakka://ServerSystem@localhost:2554/user/serverActor
, notakka://ServerSystem@localhost:2554/serverActor
... - Unfortunately,
sbt dist
won't copy any subproject libraries into the mikrokernel when theid
andname
of your sbt subprojects are not equal. Always use the name you set in your subproject settings (for examplename := "akka-shared"
) for your subproject id (lazy val shared = Project(id = "akka-shared", ...)