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

Connection opened but not connected #14

Open
SohailCheema-145 opened this issue Jun 29, 2021 · 2 comments
Open

Connection opened but not connected #14

SohailCheema-145 opened this issue Jun 29, 2021 · 2 comments

Comments

@SohailCheema-145
Copy link

Please have a look at my code below. I can see in the logs that connection is opened but when I try to send message and check connection status it shows Disconnected. I have also tried
client = Stomp.over(Stomp.ConnectionProvider.OKHTTP, "ws://a3ec3382fa18.ngrok.io/websocket");

`
client = Stomp.over(Stomp.ConnectionProvider.OKHTTP, "http://a3ec3382fa18.ngrok.io/websocket");

    client.lifecycle().subscribe(lifecycleEvent -> {
        switch (lifecycleEvent.getType()) {
            case OPENED:
                Log.d(TAG, "Stomp connection opened");

                if (client.isConnected()) {
                    Log.e(TAG, "Connected");
                } else
                    Log.e(TAG, "Disconnected");
                
                break;
            case CLOSED:
                Log.d(TAG, "Stomp connection closed");
                break;
            case ERROR:
                Log.e(TAG, "Stomp connection error", lifecycleEvent.getException());
                break;
        }
    });
    client.setHeartbeat(10000);
    client.connect();

    client.topic("/topic/chat").subscribe(message -> {
        Log.i(TAG, "ReceivedMessage: " + message.getPayload());
    });

`

@UPocek
Copy link

UPocek commented Jan 7, 2023

Still getting this error in 2023. Any solutions, please help asap?

@forresthopkinsa
Copy link
Owner

I'm sorry but this library is no longer maintained. I recommend looking at Tinder/Scarlet for Websocket applications, though I can't speak to their STOMP capabilities.

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

No branches or pull requests

3 participants