merlimat commented on a change in pull request #5045: [client] Introduce 
`batchingMaxBytes` setting in pulsar producer
URL: https://github.com/apache/pulsar/pull/5045#discussion_r317832517
 
 

 ##########
 File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/AbstractBatchMessageContainer.java
 ##########
 @@ -83,5 +89,9 @@ public void setProducer(ProducerImpl<?> producer) {
                 
.convertToWireProtocol(producer.getConfiguration().getCompressionType());
         this.compressor = 
CompressionCodecProvider.getCompressionCodec(compressionType);
         this.maxNumMessagesInBatch = 
producer.getConfiguration().getBatchingMaxMessages();
+        this.maxBytesInBatch = 
producer.getConfiguration().getBatchingMaxBytes();
+        if (this.maxBytesInBatch <= 0) {
+            this.maxBytesInBatch = MAX_MESSAGE_BATCH_SIZE_BYTES;
 
 Review comment:
   The constant `MAX_MESSAGE_BATCH_SIZE_BYTES` is set to 128 KB which is now 
different from the default max size (1MB). 
   
   In any case, I'd prefer the sanity check to be in the builder itself 

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