Take a look at the documentation for Tomcat 8, this one is for binary messages:
The default buffer size for binary messages is 8192 bytes. This may be changed for a web application by setting the servlet context initialization parameter org.apache.tomcat.websocket.binaryBufferSize to the desired value in bytes.
This is also the same for text messages:
The default buffer size for text messages is 8192 bytes. This may be changed for a web application by setting the servlet context initialization parameter org.apache.tomcat.websocket.textBufferSize to the desired value in bytes.
Found here: https://tomcat.apache.org/tomcat-8.0-doc/web-socket-howto.html
If you are using WebSocketContainer
there is also the following methods: setDefaultMaxBinaryMessageBufferSize
and setDefaultMaxTextMessageBufferSize
.
Found here: https://tomcat.apache.org/tomcat-8.0-doc/websocketapi/javax/websocket/WebSocketContainer.html