Consider using a configured WebClient
in the application context instead of creating a new one on each component
#16549
Labels
WebClient
in the application context instead of creating a new one on each component
#16549
Context
When using Spring Gateway with Spring Security on GCP, I have to connect to an external Identity Provider. The problem is that the connections are closed by the NAT. One solution is to configure the connection pool. For this, I am using this configuration:
The configuration creates a
HttpClient
that can be used to configure aWebClient
:Current Behavior
Unfortunately, the
WebClient
is never used "automatically" by the autoconfiguration and in some cases, you are even forced to reimplement some interfaces just to make it possible to share the WebClient:Expected Behavior
When a
WebClient
is in the application context, it should be used by the auto configuration.Additionally, the factories should be able to fully configure the created beans. This is not the case of the
ReactiveOidcIdTokenDecoderFactory
which cannot be configured with a WebClient and forceNimbusReactiveJwtDecoder
to create a new one.The text was updated successfully, but these errors were encountered: