merlimat commented on a change in pull request #2004: Issue 1943: remove 
serializable from builders and add loadData to load configuration from a config 
map
URL: https://github.com/apache/incubator-pulsar/pull/2004#discussion_r196984187
 
 

 ##########
 File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBuilderImpl.java
 ##########
 @@ -60,12 +59,18 @@
         this(client, new ConsumerConfigurationData<T>(), schema);
     }
 
-    private ConsumerBuilderImpl(PulsarClientImpl client, 
ConsumerConfigurationData<T> conf, Schema<T> schema) {
+    ConsumerBuilderImpl(PulsarClientImpl client, ConsumerConfigurationData<T> 
conf, Schema<T> schema) {
         this.client = client;
         this.conf = conf;
         this.schema = schema;
     }
 
+    @Override
+    public ConsumerBuilder<T> loadConf(Map<String, Object> config) {
+        this.conf = ConfigurationDataUtils.loadData(config, 
ConsumerConfigurationData.class);
 
 Review comment:
   Instead of rewriting from scratch. Would it be possible to override the 
current `conf` object? This would make make intuitive things like: 
   `builder.serviceUrl("xxx").loadConf(myMap)`
   
   Maybe it's not super-useful, but it's not evident to me that the above line 
will disregard the earlier `serviceUrl()` call.

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

Reply via email to