-
Notifications
You must be signed in to change notification settings - Fork 38.1k
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
Websocket broker disconnects when client enable heartbeats #27503
Comments
|
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
We are facing the same issue after updating the Spring Boot version from "1.5.12.RELEASE" to "2.1.9.RELEASE". ActiveMQ version is 5.15.3. |
1002 indicates that the connection was closed due to a protocol error. Without some more information, the code alone isn't enough to confirm that it's the same issue as was originally reported here. If you can capture the problem with debug or trace logging enabled, that may help to determine the nature of the error. If you manage to do that or you can provide a minimal sample that reproduces the problem, please open a new issue and we can investigate. |
@kandonorbert, @rd-o were you able to localize the problem/apply some solution for it? Spring WebSocket: 4.3.17.Release -> 5.3.3 |
I couldn't find a solution for this |
@rd-o I have the same issue and I believe it is related to the Page Visibility functionality https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API |
This sort of protocol level problem is unlikely to be caused by Spring Boot as it's only involved in configuring some of the components and not in their inter-communication. If your client is receiving a 1002, it's likely to be coming from the STOMP broker. Which broker are you using? |
RabbitMQ 3.8.16 with STOMP plugin |
What kind of configurations you mean. There are no firewalls involved between spring host & the rabbit broker and the default tcp port 61613 is open between them. Can you point to the right direction? |
I mean the configuration of Spring Framework's STOMP support. Can you reproduce the problem with debug or trace level logging enabled both in your Boot app and in the Rabbit broker? It's not yet clear to me why you think this is a Spring Boot problem rather than a problem in one of the other components that's involved. Seeing some logs that capture the problem occurring should help to narrow down the cause. |
@wilkinsona here is the log from spring boot. I am trying to reach the rabbit admin to get the logs from rabbit... |
Thanks for the logs. It looks like the app has received a
It forwards this to the broker:
The connection to the broker is then closed:
And this results in an error being sent to the client:
It looks to me like something is going wrong in the handling of the |
@jbakoc1 In my case the client and server are using Spring Boot |
Hey @snicoll do we have any update on the issue? |
hello ,Is there a solution to this problem? |
Hello, |
same problem, with spring boot 2.7.3 and rabbitmq 3.11, angular as client |
i think i may have found the reason, at least in my case, given this log:
it appears the culprit here is netty tcp client, most likely there is a timeout setting for idle connections, that in turns close the websocket, more information here: EDIT
but it didn't have any effect, aniway the trace log is this:
currently trying to figure out why the channel get disposed |
i solved my issue, actually there was not need to mess with netty/reactor or spring, since the problem was in my rabbitmq broker, the problem went away once i configured it with
|
@rd-o and those affected, can you please check if configuring the broker to keep the connection alive fixes the issue for you as well? |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
After a spring boot websocket client connects to the websocket spring boot server, the server send some heartbeats, and then after some minutes in the trace logs shows "Connection to broker closed.". Removing setTaskScheduler() from the client seems to work without problems.
Websocket client with SockJsClient and heartbeats enabled.
Websocket server with enableStompBrokerRelay() (ActiveMQ) and withSockJS()
Here a POC with the client and server, it needs a ActiveMQ broker:
https://github.com/rd-o/websocket-spring-boot-bug
The text was updated successfully, but these errors were encountered: