NaikSoftware / StompProtocolAndroid

STOMP protocol via WebSocket for Android
MIT License
597 stars 265 forks source link

Manual creation of a sessionId on stomp connection #207

Open devedelie opened 2 years ago

devedelie commented 2 years ago

I'm looking for retrieving the randomUUID that is being sent to the server during stomp connection. The reason is that I need it as a reference for few actions. As I see on server-log, the library is generating its sessionId automatically, and on server end, it looks as below:

SessionConnectedEvent={"source":{"errorHandler":null,"messageSizeLimit":65536,"headerInitializer":null,"stats":{"totalConnect":132,"totalConnected":132,"totalDisconnect":23},"supportedProtocols":["v10.stomp","v11.stomp","v12.stomp"],"statsInfo":"processed CONNECT(132)-CONNECTED(132)-DISCONNECT(23)"},"timestamp":1637770073547,"message":{"payload":"","headers":{"simpMessageType":"CONNECT_ACK","simpConnectMessage":{"payload":"","headers":{"simpMessageType":"CONNECT","stompCommand":"CONNECT","nativeHeaders":{"accept-version":["1.1,1.2"],"heart-beat":["10000,10000"]},"simpSessionAttributes":{"deviceId":"8b81e268-2cc0-4c13-9be7-626b5e7c8291"},"simpHeartbeat":[10000,10000],"simpUser":{"name":"8b81e268-2cc0-4c13-9be7-626b5e7c8291"},"simpSessionId":"99e13bde-37c5-f40b-b3c2-cc54d4b041a8"}},"simpUser":{"name":"8b81e268-2cc0-4c13-9be7-626b5e7c8291"},"simpSessionId":"99e13bde-37c5-f40b-b3c2-cc54d4b041a8"}},"user":{"name":"8b81e268-2cc0-4c13-9be7-626b5e7c8291"}}

And the information I want to get from the library, is actually this value from the above response:

"simpSessionId":"99e13bde-37c5-f40b-b3c2-cc54d4b041a8"

In general, the ideal case would be to generate this sessionId by myself and pass it with the Headers. But unfortunately it doesn't work for me, or maybe there is another way of passing this value ? Otherwise, if it isn't possible to manually generate an ID, is there any way I can trace the auto-generated sessionId ?

MarsZone commented 1 year ago

i have same question...that's too long.