In my scala application I use web sockets to get requests and send responses. When I try to pass a base64 string through web sockets following exception occurs
org.jboss.netty.handler.codec.frame.CorruptedFrameException: Max frame length of 65536 has been exceeded.
I tried the below solution to fix my issue
export SBT_OPTS="-Xms1024m -Xmx3084m -XX:MaxPermSize=1024m -Dhttp.netty.maxInitialLineLength=2621440"
It works well in the Mac OS. But when I try the same solution in my windows(changed export to set) and Ubuntu machine it doesn't work. I get the same exception message. Please help me to fix this issue. Thanks in advance
The Default buffer size set for web socket is "65536". So you should increase the websocket buffer size in the application.conf file.
You can set the limit as given below.
play.websocket.buffer.limit=2621440
Find a way to increase the maximum size of WebSocket frames. For example, in Java, Session.setMaxTextMessageBufferSize(int)
and Session.setMaxBinaryMessageBufferSize(int)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With