@@ -1043,16 +1043,20 @@ check the STOMP page of the broker to understand what kind of STOMP destinations
1043
1043
prefixes it supports.
1044
1044
====
1045
1045
1046
-
1047
- On the browser side, a client might connect as follows using
1048
- https://github.com/jmesnil/stomp-websocket[stomp.js] and the
1049
- https://github.com/sockjs/sockjs-client[sockjs-client]:
1046
+ To connect from a browser, for SockJS you can use the
1047
+ https://github.com/sockjs/sockjs-client[sockjs-client]. For STOMP many applications have
1048
+ used the https://github.com/jmesnil/stomp-websocket[jmesnil/stomp-websocket] library
1049
+ (also known as stomp.js) which is feature complete and has been used in production for
1050
+ years but is no longer maintained. At present the
1051
+ https://github.com/JSteunou/webstomp-client[JSteunou/webstomp-client] is the most
1052
+ actively maintained and evolving successor of that library and the example code below
1053
+ is based on it:
1050
1054
1051
1055
[source,javascript,indent=0]
1052
1056
[subs="verbatim,quotes"]
1053
1057
----
1054
1058
var socket = new SockJS("/spring-websocket-portfolio/portfolio");
1055
- var stompClient = Stomp .over(socket);
1059
+ var stompClient = webstomp .over(socket);
1056
1060
1057
1061
stompClient.connect({}, function(frame) {
1058
1062
}
@@ -1075,6 +1079,13 @@ Even if it did, they would be ignored, or rather overridden, on the server side.
1075
1079
sections <<websocket-stomp-handle-broker-relay-configure>> and
1076
1080
<<websocket-stomp-authentication>> for more information on authentication.
1077
1081
1082
+ For a more example code see:
1083
+
1084
+ * https://spring.io/guides/gs/messaging-stomp-websocket/[Using WebSocket to build an
1085
+ interactive web application] getting started guide.
1086
+ * https://github.com/rstoyanchev/spring-websocket-portfolio[Stock Portfolio] sample
1087
+ application.
1088
+
1078
1089
1079
1090
1080
1091
[[websocket-stomp-message-flow]]
@@ -2140,8 +2151,9 @@ The WebSocket transport configuration shown above can also be used to configure
2140
2151
maximum allowed size for incoming STOMP messages. Although in theory a WebSocket
2141
2152
message can be almost unlimited in size, in practice WebSocket servers impose
2142
2153
limits -- for example, 8K on Tomcat and 64K on Jetty. For this reason STOMP clients
2143
- such as stomp.js split larger STOMP messages at 16K boundaries and send them as
2144
- multiple WebSocket messages thus requiring the server to buffer and re-assemble.
2154
+ such as the JavaScript https://github.com/JSteunou/webstomp-client[webstomp-client]
2155
+ and others split larger STOMP messages at 16K boundaries and send them as multiple
2156
+ WebSocket messages thus requiring the server to buffer and re-assemble.
2145
2157
2146
2158
Spring's STOMP over WebSocket support does this so applications can configure the
2147
2159
maximum size for STOMP messages irrespective of WebSocket server specific message
0 commit comments