nodece commented on code in PR #25536:
URL: https://github.com/apache/pulsar/pull/25536#discussion_r3091360166
##########
pulsar-broker/src/test/java/org/apache/pulsar/client/api/DeadLetterTopicTest.java:
##########
@@ -1524,20 +1532,21 @@ public void
testDeadLetterTopicWithMaxUnackedMessagesBlocking() throws Exception
Message<byte[]> message = deadLetterConsumer.receive();
if (message != null) {
String messageContent = new String(message.getData());
- log.info("Dead letter message received: {}",
messageContent);
+ log.info().attr("messageReceived",
messageContent).log("Dead letter message received");
deadLetterConsumer.acknowledge(message);
totalInDeadLetter++;
} else {
log.warn("No more messages in DLQ");
break;
}
} catch (Exception e) {
- log.warn("Exception while receiving from DLQ", e);
+ log.warn().exception(e).log("Exception while receiving from
DLQ");
break;
}
}
- log.info("Total messages in dead letter queue: {}, Expected: {}",
totalInDeadLetter, sendMessages);
+ log.info().attr("letterQueue", totalInDeadLetter).attr("expected",
sendMessages)
+ .log("Total messages in dead letter queue, Expected");
Review Comment:
**`"letterQueue"` is a noun for the queue itself, not a count variable
name.**
```suggestion
log.info().attr("totalInDeadLetter",
totalInDeadLetter).attr("expected", sendMessages)
```
##########
pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerTest.java:
##########
@@ -4998,7 +5009,9 @@ public Message beforeSend(Producer producer, Message
message) {
public void onSendAcknowledgement(Producer producer, Message
message, MessageId msgId,
Throwable exception) {
MessageImpl msgImpl = (MessageImpl) message;
- log.info("payload.refCnf on send acknowledgement: {}",
msgImpl.getDataBuffer().refCnt());
+ log.info()
+ .attr("acknowledgement",
msgImpl.getDataBuffer().refCnt())
Review Comment:
**`"acknowledgement"` is the context from the message text, not the name for
the `refCnt()` value.**
```suggestion
.attr("refCount", msgImpl.getDataBuffer().refCnt())
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]