【发布时间】:2017-07-02 22:03:26
【问题描述】:
我正在尝试通过 protobuf 序列化/反序列化 ActorRef。根据 Akka 文档,唯一的方法是将 ActorRef 转换为 String,然后将其转换回远程 Actor 系统。
文档提到使用ExtendedActorSystem 进行反序列化(请参阅here)。但是,目前尚不清楚如何获得ExtendedActorSystem:
// Serialize
// (beneath toBinary)
val identifier: String = Serialization.serializedActorPath(theActorRef)
// Then just serialize the identifier however you like
// Deserialize
// (beneath fromBinary)
// ==== Where is this extendedSystem from? ====
val deserializedActorRef = extendedSystem.provider.resolveActorRef(identifier)
// Then just use the ActorRef
编辑
我在这里发现了这个问题:Akka (JVM): Serialize an actorref with protobuf within another message,其中提到将ActorSystem 转换为ExtendedActorSystem。这是正确的方法吗?它会一直有效吗?
【问题讨论】:
-
对这个也很好奇
-
嘿@stackverflow 你找到ExtendedActorSystem 的解决方案了吗?
标签: akka-cluster