codelipenghui commented on code in PR #21268:
URL: https://github.com/apache/pulsar/pull/21268#discussion_r1381943684


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:
##########
@@ -2800,12 +2806,34 @@ private CompletableFuture<Void> 
doTransactionAcknowledgeForResponse(MessageId me
             } else {
                 bitSetRecyclable.clear(messageIdAdv.getBatchIndex());
             }
-            cmd = Commands.newAck(consumerId, ledgerId, entryId, 
bitSetRecyclable, ackType, validationError, properties,
-                    txnID.getLeastSigBits(), txnID.getMostSigBits(), 
requestId, messageIdAdv.getBatchSize());
+            cmdList.add(Commands.newAck(consumerId, ledgerId, entryId, 
bitSetRecyclable, ackType, validationError, properties,
+                    txnID.getLeastSigBits(), txnID.getMostSigBits(), 
requestId, messageIdAdv.getBatchSize()));

Review Comment:
   But it's not free. It will use more CPU cycles to serialize to protobuf and 
the server side also need more CPU cycles to deserialize from protobuf. It will 
be a CPU killer if there are many chunk messages with many chunks. And each 
command will actually write a buffer to the netty channel, which will trigger 
the syscall to flush the socket.



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

Reply via email to