Skip to content

Commit 357fb48

Browse files
committed
Update docs on stomp.js library
Issue: SPR-15624
1 parent 513461d commit 357fb48

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

src/docs/asciidoc/web/websocket.adoc

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,16 +1043,20 @@ check the STOMP page of the broker to understand what kind of STOMP destinations
10431043
prefixes it supports.
10441044
====
10451045

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:
10501054

10511055
[source,javascript,indent=0]
10521056
[subs="verbatim,quotes"]
10531057
----
10541058
var socket = new SockJS("/spring-websocket-portfolio/portfolio");
1055-
var stompClient = Stomp.over(socket);
1059+
var stompClient = webstomp.over(socket);
10561060
10571061
stompClient.connect({}, function(frame) {
10581062
}
@@ -1075,6 +1079,13 @@ Even if it did, they would be ignored, or rather overridden, on the server side.
10751079
sections <<websocket-stomp-handle-broker-relay-configure>> and
10761080
<<websocket-stomp-authentication>> for more information on authentication.
10771081

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+
10781089

10791090

10801091
[[websocket-stomp-message-flow]]
@@ -2140,8 +2151,9 @@ The WebSocket transport configuration shown above can also be used to configure
21402151
maximum allowed size for incoming STOMP messages. Although in theory a WebSocket
21412152
message can be almost unlimited in size, in practice WebSocket servers impose
21422153
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.
21452157

21462158
Spring's STOMP over WebSocket support does this so applications can configure the
21472159
maximum size for STOMP messages irrespective of WebSocket server specific message

0 commit comments

Comments
 (0)