rikoe
rikoe

Reputation: 1699

Stomp.js is out of date and no longer maintained - which Stomp client to use with Spring Websockets?

I found it surprising that the current documentation for the Spring WebSocket Support directs users to use stomp.js for their client-side JavaScript implementation.

This project, on the ReadMe on it's GitHub page, says:

This project is no longer maintained.

If you encounter bugs with it or need enhancements, you can fork it and modify it as the project is under the Apache License 2.0.

The repository hasn't had any commits since September 2015 (which was just to add the above to the ReadMe), and no code commits since December 2014, so it has effectively been abandoned for the past 2 years.

I am unsure which of the 284 forks of the repository would be a stable and up-to-date version of the library, and there seems to be no viable alternative from a Google search.

Could someone please recommend a stable alternative that could be used instead?

Ideally my hope is the Spring team could provide some direction about the right client library to use with their STOMP support.

Upvotes: 26

Views: 16365

Answers (3)

Gary Tessman
Gary Tessman

Reputation: 543

The maintainer for https://github.com/stomp-js/stompjs seems to have forked his own thing (presumably Deepak Kumar). Of which, 'auto-reconnect' didn't actually work for me in Safari with this version and SocksJS.

var ws = new SockJS(url);
var client = Stomp.over(ws);

client.reconnect_delay = 5000;

So, It was hard for me to find the 'legit' and properly supported version as well because of this. But I did run across this link from the original authors site: https://github.com/jmesnil/stomp-websocket/issues/121 where the original author Jeff Mesnil was in conversation with Rossen Stoyanchev (anyone who knows Spring knows who he is) and seemed to have blessed the maintenance fork by Jérôme Steunou located here: https://github.com/JSteunou/webstomp-client . So, I think I'll be using this version.

Hopefully that helps others who are getting lost in the various versions of unofficial forks kludge (like I was) with very inconsistent results.

Upvotes: 2

Deepak Kumar
Deepak Kumar

Reputation: 972

Please check https://github.com/stomp-js/stompjs (@stomp/stompjs at npm). It is based on the original, however fixes known issues, supports auto reconnect, binary data, callbacks. Written in Typescript and distributed as UMD (usable from Node as well as browsers).

It also has variants for RxJS (https://github.com/stomp-js/rx-stomp) and Angular (https://github.com/stomp-js/ng2-stompjs).

This is actively maintained.

Upvotes: 7

Hristo
Hristo

Reputation: 46517

I've been wondering about this as well, but haven't been able to find anything concrete. The closest I've come across has been webstomp-client:

https://github.com/JSteunou/webstomp-client

It claims to be a fork of the original stomp.js, and it looks like it's actively maintained.


Unrelated to the question, but related to what I've been working on recently, I also found a fork of webstomp-client that implements an RxJS client as well; posting some links in case it's useful to someone in the future.

https://github.com/Clanrat/webstomp-client

https://github.com/Clanrat/webstomp-client/blob/master/src/rxclient.js

Upvotes: 15

Related Questions