I am trying to run remote actors using AKKA, on my localhost, but each time I get this error. It says dead letters encountered. I searched on internet and found out that thi
I think I see a few issues with your code that might be leading to deadletters. First, if your intention is to lookup an actor on a remote system from actorSystem2
into actorSystem1
, then you will still need to set up remoting properties for actorSystem1
, most specifically, you need to make sure it's using the RemoteActorRefProvider
. If you don't do this, system 2 will not be able to lookup a remote actor in system 1. Once you make this change, I would also change your remote actor lookup from:
val remoteActor = actorSystem2.actorFor("akka://actorSystem1@localhost:2209/user/simplisticActor")
to:
val remoteActor = actorSystem2.actorSelection("akka.tcp://actorSystem1@localhost:2209/user/simplisticActor")
The actorFor
method has been deprecated and also I think you left off the .tcp
part of the akka
protocol for looking up the remote actor.
Make these changes and then see if things work for you.