horsteff commented on issue #7492:
URL: https://github.com/apache/pulsar/issues/7492#issuecomment-656769281


   @sijie Yes, that's what I had in mind. I'm already working on it and will 
make a pull request then.
   
   One question: After digging a little in the code and thinking about possible 
fixes I would rather like to drop the `withConfig` method from 
`PulsarStandaloneBuilder` and replace it with a `withConfigFile` method. I 
don't see any other way (without major changes), to apply configuration 
settings without unexpected overwriting and in an order a user would expect. A 
config file is required in any case and with a `withConfigFile` method the 
`PulsarStandaloneBuilder` is able to read it in it's `build` method like the 
`PulsarStandaloneStarter` constructor does, which would fix the second part of 
this issue. If a user wants to change some config settings by code, it's 
possible by modifying the `ServiceConfiguration` object of the created 
`PulsarStandalone` instance after calling `PulsarStandaloneBuilder.build()` and 
before calling `PulsarStandalone.start()` without the need to create an own 
`ServiceConfiguration` instance. This would also make clear to the user, that 
modifying the config object overwrites values set via configuration file (at 
least those not for the `LocalBookkeeperEnsemble`, but that's another story).
   Dropping `PulsarStandaloneBuilder.withConfig` shouldn't be such a problem 
with existing code as currently it effectively does nothing. And it seems that 
no other user has noticed that. 8)
   Is this solution ok for you?
   


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


Reply via email to