我想使用Akka Remoting在actor之间通过网络交换消息,但对于大型String消息,我收到以下错误:
akka.remote.OversizedPayloadException: Discarding oversized payload
sent to Actor :: max allowed size 128000 bytes
, actual size of encoded class scala.
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个限制?
我发现的所有演示都展示了如何在Akka.NET中进行远程处理,所有演示均展示了最简单的用例,其中两个参与者使用本地主机在同一台计算机上运行。
我试图让Akka.NET actor连接到远程计算机,并遇到了一些困难。
代码非常简单:
客户代码:
var config = ConfigurationFactory.ParseString(@"
akka {
log-config-on-start = on
stdout-loglevel = DEBUG
loglevel = DEBUG
actor {
provider = ""Akka.Remote.RemoteActorRefProvider, Akka.Remote""
debug {
receive = on
autoreceive = on
lifecycle = on
event-stream = on
unhandled = on
}
deployment {
/remoteactor {
router = round-robin-pool
nr-of-instances = 5
remote = ""akka.tcp://system2@xxx.australiasoutheast.cloudapp.azure.com:666""
}
}
}
remote {
dot-netty.tcp {
port = 0
hostname = localhost
}
}
}
");
using (var system = ActorSystem.Create("system1", …Run Code Online (Sandbox Code Playgroud)