Skip to content

Commit 07a0a31

Browse files
committed
Heart-beat log message potentially without session id
Issue: SPR-15937 (cherry picked from commit aa4ae7a)
1 parent f3a2f57 commit 07a0a31

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2017 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.
@@ -416,7 +416,8 @@ else if (StompCommand.DISCONNECT.equals(getCommand())) {
416416
@Override
417417
public String getDetailedLogMessage(Object payload) {
418418
if (isHeartbeat()) {
419-
return "heart-beat in session " + getSessionId();
419+
String sessionId = getSessionId();
420+
return "heart-beat" + (sessionId != null ? " in session " + sessionId : "");
420421
}
421422
StompCommand command = getCommand();
422423
if (command == null) {

0 commit comments

Comments
 (0)