If you want to verify that your Props are serializable you can enable the following config option:
akka {
actor {
serialize-creators = on
}
}
我的问题是 Props
应该是可序列化的吗?为什么?
是不是因为访问了ShardRegion
?
ClusterSharding.get(actorSystem)
.start("Devices", Device.props(x, y) , settings, new DeviceMessageExtractor(t));
最佳答案
如果您想远程创建 actor, Prop 对象应该是可序列化的。该对象将被发送到远程系统,而不是远程系统将创建 actor。
请查看 https://doc.akka.io/docs/akka/current/remoting.html 的“远程创建 Actor”部分.
关于java - Akka:可序列化的 Prop ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56616370/