Comments (2)
I had the same problem. This was my old code, where after reconnection the subscriptions were lost:
stomp.startConnect().then(() => {
stomp.done('init')
stomp.subscribe( ... )
})
And this is the new working code: The subscriptions are renewed each time an onConnect
event is received:
let originalOnConnect = stomp.onConnect
stomp.onConnect = (frame: any) => {
originalOnConnect(frame)
stomp.subscribe( ... )
}
stomp.startConnect().then(() => {
stomp.done('init')
})`
Feature request: It would be great if the library could manage the subscriptions automatically 😊
from ng2-stomp-over-websocket.
Hi, Thank you @ib1987
I think one way to do it is to pass 'subscribe' to onConnect
method and every time when connection is no longer available module will try to reconnect and when connection established every 'subscribe' what we passed will happened inside onConnect
method
from ng2-stomp-over-websocket.
Related Issues (10)
- Error in angular 5 HOT 3
- Unit testing throwing TypeError: Cannot read property 'queue' of null
- Compile error with Angular 6 HOT 5
- Problems with disconnect and reconnect HOT 3
- Remove Typescript file from build HOT 1
- private Error when compiling with angular/compile-cli (ngc)
- Competible
- Invalid SockJS path 'info'
- Why in ionic-android-cordova does not work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng2-stomp-over-websocket.