Skip to content

Commit 92c9b0d

Browse files
committed
Reduce logging for unsent SUBSCRIBE messages
Closes gh-28252
1 parent c0c78bd commit 92c9b0d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

spring-websocket/src/main/java/org/springframework/web/socket/messaging/StompSubProtocolHandler.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -366,10 +366,10 @@ else if (StompCommand.UNSUBSCRIBE.equals(command)) {
366366
logger.debug("Failed to send message to MessageChannel in session " + session.getId(), ex);
367367
}
368368
else if (logger.isErrorEnabled()) {
369-
// Skip unsent CONNECT messages (likely auth issues)
370-
if (!isConnect || sent) {
371-
logger.error("Failed to send message to MessageChannel in session " + session.getId() +
372-
":" + ex.getMessage());
369+
// Skip for unsent CONNECT or SUBSCRIBE (likely authentication/authorization issues)
370+
if (sent || !(isConnect || StompCommand.SUBSCRIBE.equals(command))) {
371+
logger.error("Failed to send message to MessageChannel in session " +
372+
session.getId() + ":" + ex.getMessage());
373373
}
374374
}
375375
handleError(session, ex, message);

0 commit comments

Comments
 (0)