sijie commented on a change in pull request #4062: Delayed message delivery 
implementation
URL: https://github.com/apache/pulsar/pull/4062#discussion_r277192598
 
 

 ##########
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentDispatcherMultipleConsumers.java
 ##########
 @@ -194,7 +193,9 @@ public void sendMessages(List<Entry> entries) {
             TOTAL_AVAILABLE_PERMITS_UPDATER.addAndGet(this, 
-consumer.sendMessages(entries).getTotalSentMessages());
         } else {
             entries.forEach(entry -> {
-                int totalMsgs = getBatchSizeforEntry(entry.getDataBuffer(), 
subscription, -1);
+                MessageMetadata msgMetatada = 
Consumer.peekMessageMetadata(entry.getDataBuffer(), subscription, -1);
 
 Review comment:
   I see this pattern is used in multiple places. It would be good that you can 
still keep `getBatchSizeforEntry` and make it call `peekMessageMetadata` and 
return the total message size.

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


With regards,
Apache Git Services

Reply via email to