Giter Site home page Giter Site logo

Comments (8)

zygm0nt avatar zygm0nt commented on June 14, 2024

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.

jmesnil avatar jmesnil commented on June 14, 2024

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 CONNECTand CONNECTED frames?

from stomp-websocket.

zygm0nt avatar zygm0nt commented on June 14, 2024

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.

jmesnil avatar jmesnil commented on June 14, 2024

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.

zygm0nt avatar zygm0nt commented on June 14, 2024

Thanks for quick help! I'll stick with this solution.

from stomp-websocket.

psharpNumerex avatar psharpNumerex commented on June 14, 2024

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.

jmesnil avatar jmesnil commented on June 14, 2024

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.

chinshaw avatar chinshaw commented on June 14, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.