1

有没有办法在不使用路由器的情况下在多台机器上部署远程参与者?

在以下配置中,我可以在远程中放置多个地址吗?

akka {
  actor {
    deployment {
      /sampleActor {
        remote = "akka.tcp://sampleActorSystem@127.0.0.1:2553"
      }
    }
  }
}
4

1 回答 1

0

No, this is not possible because an actor path can only have one address component, either local or remote. The configuration is simply specifying the (one and only) address to use for the given actor path.

If you want messages to be forwarded to multiple actors distributed across multiple machines, then you either need to use a router or code this yourself by writing an actor that has the references to multiple target actors—which is essentially a custom router.

With Akka cluster this is made easier by using Cluster Aware Routers.

The links here assume Scala, but similar documentation is also available for Java.

于 2014-10-26T12:35:47.793 回答