1

We're using spring-messaging websocket with STOMP. Now we've defined multiple @SubscribeMapping methods, but is there also some sort of callback that gets fired when a client application disconnects from the socket?

We got a list of connect clients and some additional properties, like status. Status field needs to be updated when the client application disconnects.

Any suggestions on how to achieve this in Spring? I've tried implementing ApplicationListener however, there's no usefull information in the OnSessionDisconnect object.

ferdyh
  • 1,355
  • 2
  • 11
  • 29
  • Why listening on the `SessionDisconnectEvent` isn't enough for you? – Artem Bilan Nov 11 '14 at 10:57
  • Session disconnect event only lists a sessionId, there is no reference back to the original client information. – ferdyh Nov 11 '14 at 11:02
  • 1
    Why don't use `client <-> sessionId` association? I can guess that your client may use several WebScocket session, so there will be need to implement some custom direct HTTP logic, outside of WebSockets. – Artem Bilan Nov 11 '14 at 11:10

0 Answers0