Jeffrey Barrus opened SPR-11825 and commented
I am trying to subscribe to SessionConnectEvent but found that it is never published. After stepping through code, I found that the StompSubProtocolHandler ends up with null for eventPublisher after context initialization. It looks like when SubProtoocolWebSocketHandler is initialized, setProtocolHandlers is called before setApplicationEventPublisher. This results in the StompSubProtocolHandler getting its eventPublisher set to null.
See line 137 in SubProtocolWebSocketHandler.java
if (handler instanceof ApplicationEventPublisherAware) {
((ApplicationEventPublisherAware) handler).setApplicationEventPublisher(this.eventPublisher);
}
Affects: 4.0.5
Referenced from: commits e9ecaf6, 0dddb6f