You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/06/23 21:33:27 UTC

[GitHub] [pulsar] erenavsarogullari commented on a change in pull request #4539: [Pulsar-Client] Add Producer Builder API Numeric Properties Validations

erenavsarogullari commented on a change in pull request #4539: [Pulsar-Client] Add Producer Builder API Numeric Properties Validations
URL: https://github.com/apache/pulsar/pull/4539#discussion_r296498927
 
 

 ##########
 File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerBuilderImpl.java
 ##########
 @@ -213,18 +214,21 @@ private ProducerBuilderImpl(PulsarClientImpl client, ProducerConfigurationData c
 
     @Override
     public ProducerBuilder<T> batchingMaxPublishDelay(long batchDelay, @NonNull TimeUnit timeUnit) {
+        checkArgument(batchDelay >= 0, "batchDelay needs to be >= 0");
 
 Review comment:
   Firstly, thanks all for the review.
   
   There is the similar check _deprecated_ `ProducerConfiguration.setBatchingMaxPublishDelay` and could not see any use-case for negative access on code-base (**e.g:** Unit Test case)
   In general, i was thinking that this kind of validation can be useful due to _public API_. However, if there is valid use-case, it can be skipped and UT can be useful to highlight negative case.
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services