Open majidasgari opened 6 years ago
I found that the origin of problem is "The decoded text message was too big for the output buffer and the endpoint does not support partial messages" in writerRunnable
of RealWebSocket
class.
I have set the maximum size of message by registration?.setMessageSizeLimit(5000000)
on the server side. I must set the size on okhttp3 library.
I used java_websocket instead okhttp3 and got same error, this time more clear error received, at least we have error in the console
D/WebSocketsConnectionProvider: onClose: code=1009 reason=The decoded text message was too big for the output buffer and the endpoint does not support partial messages remote=true
D/WebSocketsConnectionProvider: Emit lifecycle event: CLOSED
I'm sure the server has configured correctly but I don't know how can i configure the client :(
Similar to #39; however, that issue is about receiving large payloads, and this issue seems to be about sending large payloads. Am I understanding that correctly?
Yes. Exactly. Do you have any plans to support/resolve this issue?
Stomp designed for small text messages. But thanks for issue, I am will investigate this problem, and if okhttp-ws support changing buffer size I am try to fix.
I am using this library for socket connection i'm able to receive message successfully through stompClient.topic().subscribe() but stompClient.send().subscribe() is not sending messages to the server...
This is my first time of using this library as I just learned of it. My code for connecting to the web socket is as below:
`public void connectSocket(){ TAG="LongOperation"; mStompClient = Stomp.over(WebSocket.class, TerminalDetails.WEB_SOCKET_URL); mStompClient.connect();
mStompClient.topic("/pos/asycnronous").subscribe(topicMessage -> {
Log.d(TAG, topicMessage.getPayload());
mResult = topicMessage.getPayload();
try {
JSONObject jsonObject = new JSONObject(mResult);
if (jsonObject.getString("messageType").equalsIgnoreCase(TerminalDetails.RESP_ACTIVATE_POS)
&& jsonObject.getString("tellerId").equalsIgnoreCase(TerminalDetails.tellerID)) {
listener.onMessageReceived(jsonObject);
}
} catch (JSONException e) {
e.printStackTrace();
}
});
mStompClient.send("/api/poschannel", "My first STOMP message!").subscribe(aVoid -> {
Log.d(TAG, "STOMP echo send successfully");
}, throwable -> {
Log.e(TAG, "Error send STOMP echo", throwable);
});
mStompClient.lifecycle().subscribe(lifecycleEvent -> {
switch (lifecycleEvent.getType()) {
case OPENED:
Log.d(TAG, "Stomp connection opened");
break;
case ERROR:
Log.e(TAG, "Error", lifecycleEvent.getException());
break;
case CLOSED:
Log.d(TAG, "Stomp connection closed");
break;
}
});
}`
I appreciate your prompt response, thanks in anticipation.
Any workaround for this? I'm working with a spring web app with websocket and a mobile app for remote control. I've already configured the server, but can't configure the client side. Getting this error on console after trying to send a large message:
D/class com.stomped.stomped.connection.WebSocketConnector: WebSocket is closing: The decoded text message was too big for the output buffer and the endpoint does not support partial messages
I have sent a pull request about the problem. Messages which are larger than 8k are now splitted into chunks. Stomp servers merge them as a single message. #163
Hi there. I am using this brilliant library for a stomp connection on android. Everything works for sending and subscribing message expect when I tries to send long messages to server. The length of message is 255612 characters. Connection closed on sending message without any errors. No exception in lifecycleEvent arises, and the log shows library not sending full message to server:
I developed a node-js client and sent this long messages by that library successfully.