From 99c7917124b8f5c997046bc169ec2a97ff5e62fb Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Mon, 19 Sep 2016 09:01:25 -0400 Subject: [PATCH] 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 --- .../messaging/simp/stomp/DefaultStompSession.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/DefaultStompSession.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/DefaultStompSession.java index 0b6191c02f..790ab85515 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/DefaultStompSession.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/DefaultStompSession.java @@ -480,8 +480,8 @@ public class DefaultStompSession implements ConnectionHandlingStompSession { logger.debug("Connection closed session id=" + this.sessionId); } if (!this.closing) { - handleFailure(new ConnectionLostException("Connection closed")); resetConnection(); + handleFailure(new ConnectionLostException("Connection closed")); } } @@ -671,8 +671,8 @@ public class DefaultStompSession implements ConnectionHandlingStompSession { if (logger.isDebugEnabled()) { logger.debug(error); } - handleFailure(new IllegalStateException(error)); resetConnection(); + handleFailure(new IllegalStateException(error)); } }