From c3a57c436b41b821e18ce1cb16d7ad13481dd569 Mon Sep 17 00:00:00 2001 From: zymap Date: Fri, 11 Nov 2022 10:57:34 +0800 Subject: [PATCH] [improve][client] Change the get lastMessageId to debug level --- ### Motivation When using RawReader to read the topic, the getLastMessageId continue to print to the logs, change it to the debug leve to avoid print it to much. --- .../org/apache/pulsar/client/impl/ConsumerImpl.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java index 1ca6fabe1b40c..99441631bb92d 100644 --- a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java +++ b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java @@ -2375,7 +2375,9 @@ private void internalGetLastMessageIdAsync(final Backoff backoff, long requestId = client.newRequestId(); ByteBuf getLastIdCmd = Commands.newGetLastMessageId(consumerId, requestId); - log.info("[{}][{}] Get topic last message Id", topic, subscription); + if (log.isDebugEnabled()) { + log.debug("[{}][{}] Get topic last message Id", topic, subscription); + } cnx.sendGetLastMessageId(getLastIdCmd, requestId).thenAccept(cmd -> { MessageIdData lastMessageId = cmd.getLastMessageId(); @@ -2384,8 +2386,10 @@ private void internalGetLastMessageIdAsync(final Backoff backoff, markDeletePosition = new MessageIdImpl(cmd.getConsumerMarkDeletePosition().getLedgerId(), cmd.getConsumerMarkDeletePosition().getEntryId(), -1); } - log.info("[{}][{}] Successfully getLastMessageId {}:{}", - topic, subscription, lastMessageId.getLedgerId(), lastMessageId.getEntryId()); + if (log.isDebugEnabled()) { + log.debug("[{}][{}] Successfully getLastMessageId {}:{}", + topic, subscription, lastMessageId.getLedgerId(), lastMessageId.getEntryId()); + } MessageId lastMsgId = lastMessageId.getBatchIndex() <= 0 ? new MessageIdImpl(lastMessageId.getLedgerId(),