简体   繁体   English

本地和远程参与者之间的Akka事件

[英]Akka events between local and remote actors

Using the event bus mechanism between actors in the same ActorSystem is straight-forward, but I was wondering if there was a sanctioned method for doing so between: 在同一ActorSystem中的ActorSystem之间使用事件总线机制是很简单的,但是我想知道在这两个方法之间是否存在一种认可的方法:

  • Actors in different ActorSystems in the same JVM 同一JVM中不同ActorSystems中的Actor
  • Actors in different JVMs (via remoting) 不同JVM中的Actor(通过远程处理)

Assuming that I know the paths to the actors is fine, but if there was a commonly used mechanism to discover those kinds of things as well, I'd love to hear about it. 假设我知道通向演员的路径很好,但是如果也有一种常用的机制来发现这类事物,我很想听听。

I think in this case you need to look for distributed publish-subscribe on a cluster, supposing you want to subscribe actors to events, without awareness of the location of the actors. 我认为在这种情况下,您需要在集群上寻找分布式发布-订阅,假设您想让参与者订阅事件,而又不知道参与者的位置。 This link may prove useful. 链接可能有用。

This is a note from the official Akka documentation : 这是Akka官方文档中的注释:

The event stream is a local facility, meaning that it will not distribute events to other nodes in a clustered environment (unless you subscribe a Remote Actor to the stream explicitly). 事件流是本地工具,这意味着它不会将事件分发到群集环境中的其他节点(除非您明确地将Remote Actor订阅到该流)。 If you need to broadcast events in an Akka cluster, without knowing your recipients explicitly (ie obtaining their ActorRefs), you may want to look into: Distributed Publish Subscribe in Cluster. 如果您需要在Akka群集中广播事件,而又不明确了解接收者(即获取其ActorRefs),则可能需要调查以下内容:群集中的分布式发布订阅。

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

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