Coder Social home page Coder Social logo

Comments (16)

gmallard avatar gmallard commented on June 27, 2024

KEEPALIVE might help. I would want to think about how easy / difficult that would be to implement. Thiago probably has some thoughts here.

STOMP 1.1 defines Heartbeats, which would help. But it requires both client and server be 1.1 capable.

The 1.1 spec will make it out of draft status 'real soon now' (I think).

Regards, G.

from stomp.

morellon avatar morellon commented on June 27, 2024

Try adding
used_socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, true)
to the code in the ope_socket method and see if it helps. If it does, I can't see a reason to make this the default behavior.
Otherwise, you could make your client subscribe one "ping" queue to which itself sends a message every now and then (actually the subscribe part would not be so necessary). I also recommend that you monitor your consumers and broker, so you can get a faster feedback on your connections and messages.
Let me know if the SO_KEEPALIVE helps.

Cheers, Thiago

from stomp.

gmallard avatar gmallard commented on June 27, 2024

One other thought: please make sure that your 'firewall' and 'operating system' engineers agree on idle timeout settings and that those settings are logical. I see this difficulty at 'real' work a lot.

Regards, G.

from stomp.

ripienaar avatar ripienaar commented on June 27, 2024

We have all the timeouts and stuff in line yes, but Stomp connections can be idle for days nothing will really help a whole lot there :(

I'll try the socket option and let you know

from stomp.

gmallard avatar gmallard commented on June 27, 2024

My thinking was along these lines.

I will guess that your Rehat/CentOS TCP stacks are configured for defaults:

net.ipv4.tcp_keepalive_time = 7200
net.ipv4.tcp_keepalive_probes = 9
net.ipv4.tcp_keepalive_intvl = 75

And further: if your firewalls are configured to time out in less than 75 minutes, then I believe you will still have problems, even with the added call to setsockopt.

from stomp.

gmallard avatar gmallard commented on June 27, 2024

OK, that is 75 seconds. I am fretting too much.

from stomp.

gmallard avatar gmallard commented on June 27, 2024

so .... any updates on experiments with the proposed help?

from stomp.

ripienaar avatar ripienaar commented on June 27, 2024

Been very busy last 2 weeks, its on my list of things to test

from stomp.

ripienaar avatar ripienaar commented on June 27, 2024

Sorry for the delay, I've had a chance to test this and it solves the problem well.

A configurable option that's on by default would be awesome.

thanks

from stomp.

morellon avatar morellon commented on June 27, 2024

I think we could make this as the default behavior. I don't know if we need to make it a configurable option. What do you think Guy?

from stomp.

gmallard avatar gmallard commented on June 27, 2024

Let's try it. If it breaks something for someone else, we will hear about it.

My only concern is side effects in a Windows environment. I am not concerned about Unix flavors in general.

from stomp.

gmallard avatar gmallard commented on June 27, 2024

OK, this is now on the master branch.

from stomp.

morellon avatar morellon commented on June 27, 2024

Nice, did you try it in the windows environment Guy?
Even if you didn't, let's publish it and wait for feedbacks from windows users.

from stomp.

gmallard avatar gmallard commented on June 27, 2024

Thiago - It was tested on:

a) 2 different Linux systems, with several Ruby versions on each system
b) Vista64 Home Premium, Ruby 1.9.1p378 (only WIndows I have)
c) OSX Darwin 10.7.1. Ruby 1.8.7p174 (only Mac I have)

I am going to wrap this up and publish 1.1.8 later today or early tomorrow unless you have objections.

from stomp.

morellon avatar morellon commented on June 27, 2024

No objections at all. :)

from stomp.

gmallard avatar gmallard commented on June 27, 2024

KEEPALIVE is now the default for 1.1.8.

from stomp.

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.