Comments (8)
Tried to check if there is a time correlation for those error messages.
Tue Nov 12 2013 12:53:14 GMT+0100 (CET): <<< MESSAGE message-id:ID:correspondence-55764-1384256136182-11:1:1:1:1 destination:/topic/sales timestamp:1384257194511 expires:0 subscription:sub-0 priority:0 sdfdf
Tue Nov 12 2013 12:58:15 GMT+0100 (CET): Whoops! Lost connection to ws://localhost:61614/
It seems the connection is lost after 5 minutes of inactivity.
Is that true? Can I disable this check? I would like to have sessions that are based on heartbeat and not some other inactivity checks (if-any).
from stomp-websocket.
Yes, it looks like there is an issue with the heart-beating check.
Which version of ActiveMQ are you using? There is a related bug in 5.8.0.
If you enabled the logs with stomp.js, what values do you get for the heart-beat
header in the CONNECT
and CONNECTED
frames?
from stomp-websocket.
I'm using ActiveMQ 5.9.0.
The logs are like this:
>>> CONNECT login:abc passcode:abc accept-version:1.1,1.0 heart-beat:10000,10000
<<< CONNECTED heart-beat:0,0 session:ID:correspondence-55764-1384256136182-2:4 server:ActiveMQ/5.9.0 version:1.1
Is heart-beat:0,0 a wrong return header from activemq?
from stomp-websocket.
yes, you are hitting the bug in activemq https://issues.apache.org/jira/browse/AMQ-4740 that is targeted for 5.10.0.
Until you upgrade ActiveMQ, the best way is to disable heart-beating from stomp.js:
client.heartbeat.outgoing = 0;
client.heartbeat.incoming = 0;
from stomp-websocket.
Thanks for quick help! I'll stick with this solution.
from stomp-websocket.
while we're all waiting for 5.10, I tried setting the heartbeat values to 0 and still get disconnected after 5 minutes. Is there something else I can do to prevent this? I'm reconnecting after the loss, but it's crazy annoying and I've seen some erratic behavior on chrome.
from stomp-websocket.
Unfortunately, there is nothing you can do on stomp.js side if ActiveMQ disconnects you. Until they fix their bug, you will have to handle this case and reconnect every time.
from stomp-websocket.
I have been investigating this problem and think I have a work around that will not disconnect you. It seems that ActiveMQ 5.9, 5.10 has an issue with handling the heartbeat event after about the thrid PING. But in 5.10+ a the StompInactivityMonitor was added which will handle the PONG/ server side keep alive. If you configure the connection so that only the server will handle the keep alive it appears not to disconnect the session. I have had my connection going for over 20 minutes while using the server side heartbeat. Quick note though I am using a development version of ActiveMQ, but I tested prior to see if the outgoing heartbeat worked but it was the same problem as 5.9 and 5.10 (Disconnection after a couple of tries, maybe 20 seconds). I did also add the option to use 1.2 and it is connected at 1.2 version of stomp.
client.heartbeat.outgoing = 0;
client.heartbeat.incoming = 20000;
">>> CONNECT
accept-version:1.2,1.1,1.0
heart-beat:0,20000
�" ng.html:145
"<<< PONG" ng.html:145
"<<< CONNECTED
server:ActiveMQ/5.11-SNAPSHOT
heart-beat:20000,0
session:ID:hostname
version:1.2
from stomp-websocket.
Related Issues (20)
- client send msg in a loop(loop<=200),the websocket disconnect.
- TypeError: undefined is not a constructor (evaluating 'new WebSocketClient()')
- how to user in nuxt?
- RabbitMQ Stomp Endpoint 404 Not Found http://127.0.0.1:15674/stomp HOT 2
- SignalR
- Please publish 2.3.4 version to npm repository HOT 2
- How to set prefetch count?
- Error related to durable and auto_delete settings HOT 1
- error:Uncaught Error: Cannot find module 'net' HOT 2
- subscribe inside forloop would not trigger call back HOT 1
- This Code seems to be useless!
- setting selector is ineffective
- Loosing the connection after few mins , STOMP Client <-> Spring framework
- Cannot be accessed “https://cdn.bootcdn.net/ajax/libs/stomp.js/2.3.3/stomp.min.js”
- the way to get 'now' function is wrong ?
- The connection is not established, and the server keeps sending "H" messages
- Uncaught DOMException: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.
- net module not found in stompjs
- the version was discontinued 2.3.4? HOT 1
- why subcribe failed
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 stomp-websocket.