StompProtocolAndroid icon indicating copy to clipboard operation
StompProtocolAndroid copied to clipboard

Manual creation of a sessionId on stomp connection

Open devedelie opened this issue 2 years ago • 1 comments

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 ?

devedelie avatar Nov 24 '21 16:11 devedelie

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

MarsZone avatar Mar 01 '23 17:03 MarsZone