Open LovepreetSinghLotey opened 5 years ago
I'm not completely understanding your issue. You say you can see that you're receiving the message in Logcat -- what are you seeing, exactly? I need a lot more details.
However, I highly recommend that you use Scarlet for any new projects. The StompProtocolAndroid libs are outdated.
scarlet has no documentation for STOMP, and by what i said is, the response from server is coming to the okHttpConnectionProvider's (text receive block), but is not getting emitted to my subscribe block.
Still not enough detail. Show me logs and code.
i have written code like this StompClient client = Stomp.over(Stomp.ConnectionProvider.JWS, "ws://192.168.225.133:9191/ws");
client.connect();
client.topic("/topic/greetings").subscribe(message -> {
Log.i("topic", "Received message: " + message.getPayload());
},error->Log.e("topic","===>error during subscribe topic"));
client.send("/app/hello", "world").subscribe(
() -> Log.d("sendm", "Sent data!"),
error -> Log.e("sendm", "Encountered error while sending data!", error)
);
but could getting topic subscribe logs. here is my logs D/WebSocketsConnectionProvider: onWebsocketHandshakeReceivedAsClient with response: 101 Switching Protocols D/WebSocketsConnectionProvider: onOpen with handshakeData: 101 Switching Protocols D/AbstractConnectionProvider: Emit lifecycle event: OPENED D/AbstractConnectionProvider: Send STOMP message: CONNECT version:1.1,1.0 heart-beat:0,0
��
D/socket: Stomp connection opened
Looks like you're successfully connected, are you sure the server is sending anything to that topic?
@forresthopkinsa server sending data in topic . i have solved that issue by enable cleartext support in android https://stackoverflow.com/questions/45940861/android-8-cleartext-http-traffic-not-permitted/50834600#50834600
What happens when I subscribe too fast while websocket is connecting?
@violettomsk I'd expect it to subscribe to the topic once the connection completes. Is that the behavior you observe?
StompClient client = Stomp.over(Stomp.ConnectionProvider.OKHTTP, "ws://192.168.1.75:9464/chatServer"); client.connect();
message from server is receiving and showing in logcat but is not receiving in the subscribe block