简体   繁体   English

Akka远程演员 - actorSelection未能远程

[英]Akka Remote Actor - actorSelection failed to be remote

I am building an API service on Scala that should call a remote actor for a specific microservice. 我正在Scala上构建一个API服务,它应该为特定的微服务调用远程actor。

Documentation talks about that: 文档谈到了:

val remoteSelection = context.system.actorSelection("akka.tcp://RemoteSystem@127.0.1.1:2552/user/EmailActor").resolveOne()

However, when I implement it on my code, I always get the current local ActorSystem as below: 但是,当我在我的代码上实现它时,我总是得到当前的本地ActorSystem,如下所示:

Failure(akka.actor.ActorNotFound: Actor not found for: ActorSelection[Anchor(akka://LocalSystem/deadLetters) 失败(akka.actor.ActorNotFound:未找到Actor:ActorSelection [Anchor(akka:// LocalSystem / deadLetters)

where LocalSystem is the previous ActorSystem that I used. 其中LocalSystem是我之前使用的ActorSystem。

Can anyone help me please? 有人可以帮我吗?

Thanks 谢谢

The error does say that there is no actor with this path in this system. 该错误确实表明此系统中没有此路径的actor。 Are you sure that this actor is created before calling it? 你确定在调用它之前创建了这个actor吗?

You could log its path when it is created ( println(self.path) ) to verify this. 您可以在创建路径时记录其路径( println(self.path) )以验证这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM