Hi,
On Fri, Mar 18, 2016 at 12:23 PM, Pushkar Deole <
pdeol...@gmail.com> wrote:
> Hi,
>
> I am working on a web application in which I make use of CometD javascript
> library on the client. This cometD client communicates with the CometD Java
> server deployed in Tomcat.
> In my web application, I have integrated a Chat and E-mail client (this is
> basically an application which will be used by contact centers). Through the
> Chat and E-mail client, the users can send large amount of text to the other
> party. While testing these clients, I observed that when I send a text
> larger than 7.7 KB, the remote request fails and I see the below error
> message:
>
> connectionType: "websocket"
> "The decoded text message was too big for the output buffer and the endpoint
> does not support partial messages"
> websocketCode: 1009
>
> I did a bit of searching around this and came across a configuration
> property named "maxMessageSize". This property sets the maximum number of
> bytes allowed for each web socket message. However, this property is
> available for the Client transport configuration for Java client. I am able
> to find similar property for a JavaScript client.
> Has anyone come across this error for Javascript client library and if yes
> then can I get some help around this.
TLDR: split the large messages into smaller ones.
WebSocket messages could be huge, so implementations have to put a
limit on how big they can be to avoid to blow up.
Unfortunately there is no standard. Firefox may support a value,
Chrome another, and the server yet another.
Furthermore the send max message size may be different from the
receive max message size.
Even if you can send a message from Firefox to the server, the server
then broadcasts it to other clients that may have different browsers,
so for some of them the message may be too big and fail.
Exactly because there is no standard, you have to split the message
into multiple pieces if it's too large.
The reason there is no settings for the max message size on the
JavaScript library is because it does not depend on CometD, but on the
browser, and there is no official API that CometD can use to tell the
browser what is the max message size that CometD would like the
browser to support.
--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.