stomp-js / stomp-websocket

Stomp client for Web browsers and node.js apps
https://stomp-js.github.io/stomp-websocket/
Apache License 2.0
141 stars 36 forks source link

Is there a way to increase the client's maxWebSocketFrameSize? #32

Closed ealexhaywood closed 6 years ago

ealexhaywood commented 6 years ago

Is there a way to increase the client's maxWebSocketFrameSize?

Our server can handle larger messages, and the stomp client is unable to send some of our messages. As an aside, this was difficult for me to debug because no error message is thrown by stomp-js ... My larger messages were just dropped mysteriously.

Thanks.

kum-deepak commented 6 years ago

I will have a look. Meanwhile which server you are using? What size of messages you are trying to send?

ealexhaywood commented 6 years ago

Thanks! We're using ActiveMQ on the backend. These messages are greater than 16kb but less than 50kb. About 1000-2000 line json messages.

kum-deepak commented 6 years ago

Ok, I will check.

ealexhaywood commented 6 years ago

I was actually able to define it myself by directly accessing the Client's properties like so:

    this.client = Stomp.client(this.props.url);
    this.client.maxWebSocketFrameSize = 128 * 1024; // 128kb

Everything works :)

kum-deepak commented 6 years ago

Planning for next version of stompjs is on the way. Your participation will be really appreciated, please join at https://github.com/stomp-js/stompjs/issues/1

jmls commented 6 years ago

I am having the same problem, but can't seem to fix it right .. I have set this.client.maxWebSocketFrameSize = 128 * 1024 * 2048; - which makes it maxWebSocketFrameSize: 268435456,

yet when I send a large (1.2MB) message I get this crash

reason: 'Frame size of 1233300 bytes exceeds maximum accepted frame size',

anyone got any clue ?

wazirsoft commented 6 years ago

@jmls do you have these two parameters added to transportConnector in activemq.xml file?

wireFormat.maxFrameSize=104857600 websocket.maxTextMessageSize=999999

like this


<transportConnectors>
    <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600&amp;websocket.maxTextMessageSize=999999"/>
</transportConnectors>
jmls commented 6 years ago

I'm not running activemq , but will look at the rabbitmq options ;) thanks