Skip to content

Commit 81f6c22

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 78a8245 commit 81f6c22

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,8 @@ public void afterConnectionClosed() {
480480
logger.debug("Connection closed session id=" + this.sessionId);
481481
}
482482
if (!this.closing) {
483-
handleFailure(new ConnectionLostException("Connection closed"));
484483
resetConnection();
484+
handleFailure(new ConnectionLostException("Connection closed"));
485485
}
486486
}
487487

@@ -671,8 +671,8 @@ public void run() {
671671
if (logger.isDebugEnabled()) {
672672
logger.debug(error);
673673
}
674-
handleFailure(new IllegalStateException(error));
675674
resetConnection();
675+
handleFailure(new IllegalStateException(error));
676676
}
677677
}
678678

0 commit comments

Comments
 (0)