WrathChaos/StompClientLib

stompClientDidConnect not called with Spring boot

DavidTomic opened this issue · 11 comments

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.

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 :(

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

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

Thanks,
Dem

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

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

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

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

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

@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

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

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