Open
Description
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());
});
`
Metadata
Metadata
Assignees
Labels
No labels