Comments (16)
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.
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.
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.
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.
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.
OK, that is 75 seconds. I am fretting too much.
from stomp.
so .... any updates on experiments with the proposed help?
from stomp.
Been very busy last 2 weeks, its on my list of things to test
from stomp.
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.
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.
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.
OK, this is now on the master branch.
from stomp.
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.
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.
No objections at all. :)
from stomp.
KEEPALIVE is now the default for 1.1.8.
from stomp.
Related Issues (20)
- Unexpected ACK received for message-id HOT 7
- multihost failover not really working HOT 1
- netio.rb:47:in `block (2 levels) in _receive': Connected, header read is nil, is this really a Stomp Server? (Stomp::Error::StompServerError) HOT 4
- Nasty-looking exception under jRuby HOT 3
- 1.4.5 gives me a ServerFrameNameError HOT 6
- OpenSSL Deprecations HOT 2
- New Release request HOT 3
- Code for ENV keys not in release HOT 3
- Support Stomp+SSL Url Strings in non-failover case. HOT 4
- Header decode shortcoming HOT 1
- stdout polluted with stack trace HOT 1
- Amazon ActiveMQ drops connection for long running listeners HOT 3
- rspec3 - doubles or partial doubles from rspec-mocks outside .... HOT 6
- Warning: constant ::Fixnum is deprecated HOT 1
- Provide tagged 1.4.9 release HOT 1
- Is there any method to check if subscription is present? HOT 1
- Subscribers are not receiving all messages that we are publishing HOT 9
- Man pages Debian.
- URL options not supported when passing URL to client
- What range of ruby versions are supported?
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.