我正在使用Akka-Cluster并使用Akka IO通过Tcp在网络上发送大型对象。数据被削减成非常小的块。 ByteString通过' Received'收到的数据大小。消息很小(大约7KB)。是否有任何配置设置可以一次发送和接收更大的ByteStrings?
答案 0 :(得分:1)
接收的ByteString的大小可在application.conf文件中配置。这是默认配置:
akka.io.tcp {
# The number of bytes per direct buffer in the pool used to read or write
# network data from the kernel.
direct-buffer-size = 128 KiB
# The maximal number of direct buffers kept in the direct buffer pool for
# reuse.
direct-buffer-pool-limit = 1000
# The maximum number of bytes delivered by a `Received` message. Before
# more data is read from the network the connection actor will try to
# do other work.
# The purpose of this setting is to impose a smaller limit than the
# configured receive buffer size. When using value 'unlimited' it will
# try to read all from the receive buffer.
max-received-message-size = unlimited
}
尝试更改这些设置。由于max-received-message-size默认为无限制,因此您的问题可能是由缓冲区大小引起的。