Skip to content

Large size Websocket over Stomp (with Sockjs) Messages not getting delivered #31901

Closed as not planned
@insuresense

Description

@insuresense

We have a Spring backend Application with Angular Frontend.

When sending msgs from backend to frontend, some large msgs (size ard 80 - 125KB) are not being delivered. When i cut down the incoming object and make it smaller (mostly <64KB) it gets delivered.

@stomp/rx-stomp library is being used to send websocket msgs to backend. Here are some relevant configurations

export const myRxStompConfig: RxStompConfig = {
  webSocketFactory: () => {
     return new SockJS('/api/process/websocket');
    },
  logRawCommunication: false,
  splitLargeFrames: true,
  maxWebSocketChunkSize: 8 * 1024,
}

Here are some relevant configurations on backend side

public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
    @Override
    public void configureWebSocketTransport(WebSocketTransportRegistration registry){
        registry.setMessageSizeLimit(8192 * 1024); // default : 64 * 1024
        registry.setSendTimeLimit(20 * 10000); // default : 10 * 10000
        registry.setSendBufferSizeLimit(10 * 512 * 1024); // default : 512 * 1024
    }
	@Override
	public void registerStompEndpoints(StompEndpointRegistry registry) {
		registry.addEndpoint("/websocket").setAllowedOriginPatterns("*").withSockJS()
            .setStreamBytesLimit(1024*1024);
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: webIssues in web modules (web, webmvc, webflux, websocket)status: duplicateA duplicate of another issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions