rschmitt commented on PR #773:
URL: 
https://github.com/apache/httpcomponents-client/pull/773#issuecomment-3700899735

   I think "defaults" are a red herring here. The Apache client defaults are 
_never_ going to work for the original requester, because the client is 
obviously not going to use his particular corporate proxy as the default value 
for `proxyHost` and `proxyPort`. All he's asking for is a way to _override_ the 
defaults, _without changing code_:
   
   > Should this project be changed so that by default without code you can use 
system properties to configure the proxy?
   
   All we need to do to solve his problem is define a new system property for 
the Apache client that, when set, has the same effect as calling 
`.useSystemProperties()` everywhere. This fixes the _actual_ problem (locus of 
control) in a fully backwards-compatible way and without all the API churn I'm 
seeing in this PR. We already seem to be in agreement that "the client never 
queries system properties by default" is a totally obsolete constraint (and the 
Java platform feature that motivated it [is deprecated for 
removal](https://openjdk.org/jeps/411)), so we're well within our rights to add 
a new opt-in system property that meets this need. The API impact would be 
zero, and the code change would probably be small enough to backport to 
previous versions.
   
   Regarding backwards compatibility: flipping the default behavior after 
twenty years is virtually guaranteed to cause problems. There may be 
applications with inert copy-pasted system properties that don't actually work. 
There may be applications that are using those system properties to configure 
_other_ libraries, e.g. `HttpsURLConnection`, while supplying the equivalent 
configuration to Apache programmatically. There may be test suites with 
fixtures or parallelization configs that don't expect client configuration to 
be affected by system properties (global mutable state). There's just a huge 
list of things I _don't_ have to worry about if we simply make this an opt-in 
behavior (which, as I pointed out, it already is -- it's not a "default" in the 
sense that a socket timeout value or a retry strategy is a default).


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to