sijie commented on a change in pull request #3193: [Pulsar-Client] Extends
ProducerBuilder Validations
URL: https://github.com/apache/pulsar/pull/3193#discussion_r241932769
##########
File path:
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerBuilderImpl.java
##########
@@ -228,13 +230,16 @@ private ProducerBuilderImpl(PulsarClientImpl client,
ProducerConfigurationData c
}
@Override
- public ProducerBuilder<T> property(@NonNull String key, @NonNull String
value) {
+ public ProducerBuilder<T> property(String key, String value) {
+ checkArgument(StringUtils.isNotBlank(key), "property key cannot be
blank");
conf.getProperties().put(key, value);
return this;
}
@Override
public ProducerBuilder<T> properties(@NonNull Map<String, String>
properties) {
+ properties.keySet().forEach(key ->
+ checkArgument(StringUtils.isNotBlank(key), "properties' key
cannot be blank"));
Review comment:
check value as well.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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