You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Within static fields, it was not possible to access project dependencies
at runtime. Specifically, when launching the spring petclinic
microservices demo, the API gateway that uses HttpClient crashed because
reactor.netty.transport.ProxyProvider wasn't available when evaluating
the static field.
I'm fairly sure this is due to the app being launched with
org.springframework.boot.loader.JarLauncher, which reconfigures the
classpath during startup. To work around this, we defer loading these
inaccessible types until the intercepted HttpClient constructor. That
probably creates a very minor performance hit, but nothing significant.
If this does become significant in future, we could probably preserve
the fields, and make constructor initialization a one-off, but it's more
complicated and risky, so let's not bother for now. Only matters if
you're creating very very large numbers of HttpClients in a hot loop,
which seems unlikely.
0 commit comments