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

stompClientDidConnect not called with Spring boot #35

Closed
DavidTomic opened this issue Feb 2, 2019 · 11 comments
Closed

stompClientDidConnect not called with Spring boot #35

DavidTomic opened this issue Feb 2, 2019 · 11 comments
Assignees
Labels

Comments

@DavidTomic
Copy link

Hi,

I know this is more Spring boot question but hopefully, someone can help me here.

I am trying to establish a connection using this lib and Spring boot.

I have a Spring boot project with only one file added:

@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {

    @Override
    public void configureMessageBroker(MessageBrokerRegistry config) {
        config.enableSimpleBroker("/topic");
        config.setApplicationDestinationPrefixes("/app");
    }

    @Override
    public void registerStompEndpoints(StompEndpointRegistry registry) {
        registry.addEndpoint("/hello").withSockJS();
    }

}

I published above code here:
ws://35.159.46.108:8080/hello/websocket

When I start StompClientLib-Example with above ws url I only get
"WebSocket is connected"
and never get
"stompClientDidConnect"

Please help me, thank you.

@DavidTomic
Copy link
Author

The solution is to downgrade Spring boot from 2.1.2.RELEASE to 2.0.8.RELEASE.

Spent more than half a day for this :(

@demetrio812
Copy link

Hello guys, today I had the same problem and I've found a way to fix it without downgrading (it wasn't an option for me).

Basically we need to send the accept-versions header with the CONNECT command:

connectionHeaders = [StompCommands.commandHeaderAcceptVersion:"1.1,1.2"]

Check this commit for more info on where to put it:

demetrio812@6c924ee

(the real change is just one line, all the rest is just spacing caused by the formatter)

@WrathChaos can you please integrate it in the next release?

@DavidTomic you can use my fork in the meantime

Thanks,
Dem

@demetrio812
Copy link

Please @DavidTomic or @WrathChaos can you also reopen this issue?

Thanks,
Dem

@WrathChaos WrathChaos reopened this Feb 14, 2019
@WrathChaos
Copy link
Owner

Hello @demetrio812,
I'm going to integrate and test it next week. Awesome work! Thank you :)

@abbasqamar
Copy link

i got same problem.. i can help if u did resovle it..

@WrathChaos
Copy link
Owner

WrathChaos commented Apr 30, 2019

Hello @demetrio812 , @abbasqamar and @DavidTomic,
First of all, I'm so sorry about postponing the support of Spring boot 2.1.x.
Finally I've spent time and integrated the support of Spring boot 2.1.x also I made the compatibility Swift Version 5.
Please test it out and give me a feedback :) If there is a problem about the new 1.3.0 version, please write the issue or open a new one :)
Thank you so much!

Version 1.3.0

@duannl
Copy link

duannl commented Jun 20, 2019

I tried Version 1.3.0 but it's still not working. I also tested with @DavidTomic repo and it worked well.

@WrathChaos
Copy link
Owner

Hello @duannl,
Can you provide me with an example to work on it? I'm able to work with version 1.3.0.

@duannl
Copy link

duannl commented Jun 22, 2019

@WrathChaos I'm sorry, because of company's policy, I cannot provide the code. I also tested with the commit in the below link and it worked:
https://github.com/WrathChaos/StompClientLib/issues/43

@mleatherb
Copy link

I'm also experiencing the same issue. on SpringBoot 2.1.6

@WrathChaos
Copy link
Owner

@mleatherb It should work on the latest release. Which version are you working on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants