Search code examples
springspring-websocket

spring websocket SessionDisconnectEvent


I want to detect disconnected users. I try to listen SessionDisconnectEvent, but eventPublisher in StompSubProtocolHandler is always null and it never publish. I'm using 4.0.5


Solution

  • Here you are - https://jira.spring.io/browse/SPR-11825: it's really a bug.

    As you see by comments from that JIRA, to fix it as a workaround you should configure WebSocket Broker @EnableWebSocketMessageBroker and JavaConfig instead of <websocket:message-broker> XML.

    I think we'll take care of that soon.