Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heartbeat not response #66

Closed
leanme opened this issue Sep 2, 2019 · 3 comments · Fixed by #91
Closed

heartbeat not response #66

leanme opened this issue Sep 2, 2019 · 3 comments · Fixed by #91

Comments

@leanme
Copy link

leanme commented Sep 2, 2019

ActiveMQ: 5.15.9
Client:v2.0.3
ConnectOptions:

	options := []func(*stomp.Conn) error{
		stomp.ConnOpt.Login(user, pwd),
		stomp.ConnOpt.Host("/" + host),
		stomp.ConnOpt.UseStomp,
		stomp.ConnOpt.HeartBeat(time.Minute, time.Minute),
	}

if no data is been sent for a while, readTimeoutChannel in processLoop is triggerred.

@teefax
Copy link

teefax commented Jun 10, 2020

Try setting HeartBeatGracePeriodMultiplier to something greater than 2 -- see #32 (comment)

@worg
Copy link
Collaborator

worg commented Jun 11, 2020

@leanme did it work the solution given by @teefax?
If so, please close the issue

@anthonyraymond
Copy link

anthonyraymond commented Jan 9, 2021

I've encoutered that as well, i believe that there is an issue in the server/client/conn.go with the writeTimeout in processLoop.

If the server receives a message, the timer and timerChannel gets reassigned because of the variables scope.
I'll send a PR tomorrow.

anthonyraymond added a commit to anthonyraymond/stomp that referenced this issue Jan 9, 2021
Whenever the reading loop was reading data it had the side effect of reseting the *writeTimeout* timer used to send heart beat to the client (this was due to variable scope).
If the timer was rested too much in a row the heart beat will not occurred and it will end up in the client disconnecting.

Fix go-stomp#66
@worg worg closed this as completed in #91 Jan 13, 2021
worg added a commit that referenced this issue Jan 13, 2021
Fix heart beat problem in server/client/conn.go closes #66
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants