Improve handling of disconnects in STOMP broker relay

This is a backport of:
990f5bb720

Issue: SPR-11655
This commit is contained in:
Rossen Stoyanchev
2014-04-28 10:06:41 -04:00
parent c97c246940
commit cb712afa97
3 changed files with 43 additions and 15 deletions

View File

@@ -368,6 +368,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();