public void actorExists() throw ActorNotFound{
FiniteDuration duration = Duration.create(3, TimeUnit.SECONDS);
String actorPath = "akka://test/studentid";
Await.result(actorSystem.actorSelection(actorPath).resolveOne(new Timeout(duration)), duration);
return true;
}
This code is able to identify actors in local node but not from cluster. If no actor exist in local node it throws actor not found exception if exist it return true.