Automatic reconnect with Stomp.js in Node.js application

后端 未结 2 1024
半阙折子戏
半阙折子戏 2020-12-08 16:25

I\'m working with an application that is written in Node.js and Express, and I\'m trying to use the Stomp.js client to connect to an ActiveMQ server.

I can get the a

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-08 16:33

    The original sompjs is no longer maintained. Please use https://github.com/stomp-js/stomp-websocket This version has support for automatic re-connection. On each successful connection, the connect callback is called where you can do your subscribes.

    If you are using Angular 2, 4, or 5. You should look at https://github.com/stomp-js/ng2-stompjs This package not only support automatic re-connection, but it will also re-subscribe all queues and send any pending messages.

提交回复
热议问题