Skip to content

Commit f2f2f67

Browse files
committed
[broker-30] Update debug message
1 parent b1aa456 commit f2f2f67

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

core-service/src/main/java/javasabr/mqtt/service/impl/InMemorySubscriptionService.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,10 @@ private void sendRetainedMessages(MqttUser user, Subscription subscription) {
145145
SubscribeAckReasonCode subscribeAckReasonCode = subscription
146146
.qos()
147147
.subscribeAckReasonCode();
148+
String clientId = user.clientId();
148149
if (subscribeAckReasonCode.ordinal() > 2) {
149150
log.debug(
150-
user.clientId(),
151+
clientId,
151152
subscription,
152153
subscribeAckReasonCode,
153154
"[%s] Unable to send retained messages for [%s] due to wrong subscribeAckReasonCode [%s]"::formatted);
@@ -164,12 +165,9 @@ private void sendRetainedMessages(MqttUser user, Subscription subscription) {
164165
count++;
165166
}
166167
if (errorResult != null) {
167-
log.debug(user.clientId(), errorResult, "[%s] Error occurred [%s] during sending retained messages"::formatted);
168+
log.debug(clientId, errorResult, "[%s] Error occurred [%s] during sending retained messages"::formatted);
168169
} else {
169-
log.debug(
170-
user.clientId(),
171-
count,
172-
"[%s] Successfully started delivering retained messages to [%s] subscribers"::formatted);
170+
log.debug(clientId, count, "[%s] Delivering [%s] retained messages has been started"::formatted);
173171
}
174172
}
175173
}

0 commit comments

Comments
 (0)