Improve handling of disconnects in STOMP broker relay

Issue: SPR-11655
This commit is contained in:
Rossen Stoyanchev
2014-04-03 22:31:10 -04:00
parent 3e74d3b2fb
commit 990f5bb720
4 changed files with 59 additions and 17 deletions

View File

@@ -367,6 +367,10 @@ public class StompSubProtocolHandler implements SubProtocolHandler, ApplicationE
this.userSessionRegistry.unregisterSessionId(userName, session.getId());
}
if (logger.isDebugEnabled()) {
logger.debug("WebSocket session ended, sending DISCONNECT message to broker");
}
StompHeaderAccessor headers = StompHeaderAccessor.create(StompCommand.DISCONNECT);
headers.setSessionId(session.getId());
Message<?> message = MessageBuilder.withPayload(new byte[0]).setHeaders(headers).build();