Simple broker sends notice after disconnect
Before this change the simple broker simply removed subscriptions upon receiving a DISCONNECT message assuming it was a result of a client STOMP WebSocket session ending. However, if the server-side application sends a DISCONNECT to the broker in order to terminate a session, the STOMP WebSocket session could remain unware without any further action. This change ensures the simple broker sends a DISCONNECT_ACK message downstream whenever it receives a DISCONNECT. Issue: SPR-12288
This commit is contained in:
@@ -393,6 +393,10 @@ public class StompSubProtocolHandler implements SubProtocolHandler, ApplicationE
|
||||
if (SimpMessageType.CONNECT_ACK.equals(stompAccessor.getMessageType())) {
|
||||
stompAccessor = convertConnectAcktoStompConnected(stompAccessor);
|
||||
}
|
||||
else if (SimpMessageType.DISCONNECT_ACK.equals(stompAccessor.getMessageType())) {
|
||||
stompAccessor = StompHeaderAccessor.create(StompCommand.ERROR);
|
||||
stompAccessor.setMessage("Session closed.");
|
||||
}
|
||||
else if (stompAccessor.getCommand() == null || StompCommand.SEND.equals(stompAccessor.getCommand())) {
|
||||
stompAccessor.updateStompCommandAsServerMessage();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user