Skip to content

Commit

Permalink
Reduce logging for unsent SUBSCRIBE messages
Browse files Browse the repository at this point in the history
Closes gh-28252
  • Loading branch information
rstoyanchev committed Oct 16, 2024
1 parent c0c78bd commit 92c9b0d
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -366,10 +366,10 @@ else if (StompCommand.UNSUBSCRIBE.equals(command)) {
logger.debug("Failed to send message to MessageChannel in session " + session.getId(), ex);
}
else if (logger.isErrorEnabled()) {
// Skip unsent CONNECT messages (likely auth issues)
if (!isConnect || sent) {
logger.error("Failed to send message to MessageChannel in session " + session.getId() +
":" + ex.getMessage());
// Skip for unsent CONNECT or SUBSCRIBE (likely authentication/authorization issues)
if (sent || !(isConnect || StompCommand.SUBSCRIBE.equals(command))) {
logger.error("Failed to send message to MessageChannel in session " +
session.getId() + ":" + ex.getMessage());
}
}
handleError(session, ex, message);
Expand Down

0 comments on commit 92c9b0d

Please sign in to comment.