Configurable maximum frame size for Netty driver

- also, increased default to 128k
This commit is contained in:
Endre Sándor Varga 2013-04-25 13:34:50 +02:00
parent a4b485968c
commit 7e36a72bd8
2 changed files with 15 additions and 3 deletions

View file

@ -336,11 +336,18 @@ akka {
# Sets the send buffer size of the Sockets,
# set to 0b for platform default
send-buffer-size = 32000b
send-buffer-size = 256000b
# Sets the receive buffer size of the Sockets,
# set to 0b for platform default
receive-buffer-size = 32000b
receive-buffer-size = 256000b
# Maximum message size the transport will accept. Please note that
# UDP does not support arbitrary large datagrams, so this setting
# has to be chosen carefully when using UDP.
# Both send-buffer-size and receive-buffer-size settings has to
# be adjusted to be able to buffer messages of maximum size.
maximum-frame-size = 128000b
# Sets the size of the connection backlog
backlog = 4096

View file

@ -100,6 +100,11 @@ class NettyTransportSettings(config: Config) {
val ReceiveBufferSize: Option[Int] = optionSize("receive-buffer-size")
val MaxFrameSize: Int = getBytes("maximum-frame-size").toInt match {
case x if x < 32000 throw new ConfigurationException(s"Setting 'maximum-frame-size' must be at least 32000 bytes")
case other other
}
val Backlog: Int = getInt("backlog")
val Hostname: String = getString("hostname") match {
@ -228,7 +233,7 @@ class NettyTransport(val settings: NettyTransportSettings, val system: ExtendedA
implicit val executionContext: ExecutionContext = system.dispatcher
override val schemeIdentifier: String = (if (EnableSsl) "ssl." else "") + TransportMode
override def maximumPayloadBytes: Int = 32000 // The number of octets required by the remoting specification
override def maximumPayloadBytes: Int = settings.MaxFrameSize
private final val isDatagram = TransportMode == Udp