Skip to content

Commit 62b02c2

Browse files
committed
Reset connection before delegating to handler
Resetting the connection first before invoking a failure callback on the application handler ensures that any checks to isConnected will return false. Issue: SPR-14721
1 parent a0773ae commit 62b02c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/DefaultStompSession.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,8 @@ public void afterConnectionClosed() {
456456
logger.debug("Connection closed session id=" + this.sessionId);
457457
}
458458
if (!this.closing) {
459-
handleFailure(new ConnectionLostException("Connection closed"));
460459
resetConnection();
460+
handleFailure(new ConnectionLostException("Connection closed"));
461461
}
462462
}
463463

@@ -647,8 +647,8 @@ public void run() {
647647
if (logger.isDebugEnabled()) {
648648
logger.debug(error);
649649
}
650-
handleFailure(new IllegalStateException(error));
651650
resetConnection();
651+
handleFailure(new IllegalStateException(error));
652652
}
653653
}
654654

0 commit comments

Comments
 (0)