eolivelli commented on a change in pull request #10166:
URL: https://github.com/apache/pulsar/pull/10166#discussion_r611051284



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
##########
@@ -854,7 +854,17 @@ private void sendFlowPermitsToBroker(ClientCnx cnx, int 
numMessages) {
                 log.debug("[{}] [{}] Adding {} additional permits", topic, 
subscription, numMessages);
             }
 
-            cnx.ctx().writeAndFlush(Commands.newFlow(consumerId, numMessages), 
cnx.ctx().voidPromise());
+            cnx.ctx().writeAndFlush(Commands.newFlow(consumerId, numMessages))
+                    .addListener(writeFuture -> {
+                        if (log.isDebugEnabled()) {

Review comment:
       in case of not "debug enabled"...can we keep using the voidPromise ?
   we are not in an hotpath but we can save a little resources.
   
   or is it worthless ?




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to