Skip to content

Support receiving fragmented STOMP frames [SPR-11527] #16152

Closed
@spring-projects-issues

Description

@spring-projects-issues

Sébastien Deleuze opened SPR-11527 and commented

Current Stomp.js and Dart STOMP library behavior is to split data bigger than 16 KBytes (see related Stomp.js source code) into multiple Websocket messages. This STOMP frame fragmentation mechanism has been implemented in order to support transmitting bigger messages than the maximum Websocket message size configured on servers.

Since Stomp over Websocket has not been specified yet, and since both Stomp.js (the most widely used implementation on client side) and Dart STOMP library have this behavior, it is something the Spring Framework should be able to handle.

Spring 4.0.2 implementation currently assume that 1 Websocket message = 1 STOMP frame, so when a STOMP frame bigger than 16 KBytes (not that unusual) is sent by the client over multiple WebSocket messages, Spring throw the following exception : "IllegalStateException: Not a valid STOMP frame: SEND". In order to fix that, we should support STOMP frame split into multiple Websocket messages, by accumulating data received threw a WebSocketSession until the end of the STOMP frame has been reached.

A configuration option with a reasonable default may allow to configure maximum STOMP frame size.

As discussed with Rossen Stoyanchev, since this issue can occur often as soon as you use Spring STOMP support, I tentatively target 4.0.3 release for the moment, but we could postpone it to 4.1 if needed depend on the fix.

I will put feedbacks as soon as the fix will be implemented.


Affects: 4.0.2

Issue Links:

Metadata

Metadata

Assignees

Labels

in: messagingIssues in messaging modules (jms, messaging)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions