“最大允许大小128000字节,编码类scala的实际大小”在akka远程处理时出错

时间:2016-04-18 04:09:20

标签: serialization akka akka-cluster akka-remoting

我想使用Akka Remoting在actor之间通过网络交换消息,但对于大型String消息,我收到以下错误:

akka.remote.OversizedPayloadException: Discarding oversized payload 
sent to Actor :: max allowed size 128000 bytes
, actual size of encoded class scala.

我该如何解决这个限制?

1 个答案:

答案 0 :(得分:16)

我添加了以下配置,现在一切正常:

akka {

  actor {
    provider = "akka.remote.RemoteActorRefProvider"
  }

  remote {
    maximum-payload-bytes = 30000000 bytes
    netty.tcp {
      hostname = "127.0.0.1"
      port = 2552
      message-frame-size =  30000000b
      send-buffer-size =  30000000b
      receive-buffer-size =  30000000b
      maximum-frame-size = 30000000b
    }
  }
}