Skip to content

Commit aa4ae7a

Browse files
committed
Heart-beat log message potentially without session id
Issue: SPR-15937
1 parent 496223a commit aa4ae7a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,8 @@ else if (StompCommand.DISCONNECT.equals(getCommand())) {
429429
@Override
430430
public String getDetailedLogMessage(@Nullable Object payload) {
431431
if (isHeartbeat()) {
432-
return "heart-beat in session " + getSessionId();
432+
String sessionId = getSessionId();
433+
return "heart-beat" + (sessionId != null ? " in session " + sessionId : "");
433434
}
434435
StompCommand command = getCommand();
435436
if (command == null) {

0 commit comments

Comments
 (0)