Interface WebClientProvider
Deprecated.
since 5.0
Provider for
Client instances are typically cached allowing reuse of pooled connections if configured on the
WebClient
s using a pre-configured scheme
. This class returns WebClient
for a
specific endpoint
and encapsulates common configuration aspects of WebClient
so
that code using WebClient
is not required to apply further configuration to the actual client. Client instances are typically cached allowing reuse of pooled connections if configured on the
ClientHttpConnector
.- Since:
- 3.2
- Author:
- Christoph Strobl, Mark Paluch, Huw Ayling-Miller, Peter-Josef Meisch
-
Method Summary
Modifier and TypeMethodDescriptionstatic WebClientProvider
Deprecated.static WebClientProvider
create
(String scheme, ClientHttpConnector connector) Deprecated.get
(InetSocketAddress endpoint) Deprecated.Obtain theWebClient
configured withdefault HTTP headers
andConsumer
error callback for a givenendpoint
.Deprecated.Obtain theHttpHeaders
to be used by default.Deprecated.Obtain theerror listener
to be used;Deprecated.Obtain thepathPrefix
to be used.static WebClientProvider
getWebClientProvider
(ClientConfiguration clientConfiguration) Deprecated.Creates aWebClientProvider
for the given configurationstatic WebClientProvider
http()
Deprecated.withDefaultHeaders
(HttpHeaders headers) Deprecated.Create a new instance ofWebClientProvider
applying the given headers by default.withErrorListener
(Consumer<Throwable> errorListener) Deprecated.Create a new instance ofWebClientProvider
calling the givenConsumer
on error.withPathPrefix
(String pathPrefix) Deprecated.Create a new instance ofWebClientProvider
where HTTP requests are called with the given path prefix.withRequestConfigurer
(Consumer<WebClient.RequestHeadersSpec<?>> requestConfigurer) Deprecated.Create a new instance ofWebClientProvider
calling the givenConsumer
to configure the requests of thisWebClient
.withWebClientConfigurer
(Function<WebClient, WebClient> webClientConfigurer) Deprecated.
-
Method Details
-
http
Deprecated.- Returns:
- the resulting
WebClientProvider
.
-
create
Deprecated.- Parameters:
scheme
- protocol scheme such as http or https.- Returns:
- the resulting
WebClientProvider
.
-
create
Deprecated.- Parameters:
scheme
- protocol scheme such as http or https.connector
- the HTTP connector to use. Can be null.- Returns:
- the resulting
WebClientProvider
.
-
get
Deprecated.Obtain theWebClient
configured withdefault HTTP headers
andConsumer
error callback for a givenendpoint
. -
getDefaultHeaders
HttpHeaders getDefaultHeaders()Deprecated.Obtain theHttpHeaders
to be used by default.- Returns:
- never null.
HttpHeaders.EMPTY
by default.
-
getErrorListener
Deprecated.Obtain theerror listener
to be used;- Returns:
- never null.
-
getPathPrefix
Deprecated.Obtain thepathPrefix
to be used.- Returns:
- the pathPrefix if set.
- Since:
- 4.0
-
withDefaultHeaders
Deprecated.Create a new instance ofWebClientProvider
applying the given headers by default.- Parameters:
headers
- must not be null.- Returns:
- new instance of
WebClientProvider
.
-
withErrorListener
Deprecated.Create a new instance ofWebClientProvider
calling the givenConsumer
on error.- Parameters:
errorListener
- must not be null.- Returns:
- new instance of
WebClientProvider
.
-
withPathPrefix
Deprecated.Create a new instance ofWebClientProvider
where HTTP requests are called with the given path prefix.- Parameters:
pathPrefix
- Path prefix to add to requests- Returns:
- new instance of
WebClientProvider
- Since:
- 4.0
-
withWebClientConfigurer
Deprecated.- Parameters:
webClientConfigurer
- configuration function- Returns:
- new instance of
WebClientProvider
- Since:
- 4.0
-
withRequestConfigurer
WebClientProvider withRequestConfigurer(Consumer<WebClient.RequestHeadersSpec<?>> requestConfigurer) Deprecated.Create a new instance ofWebClientProvider
calling the givenConsumer
to configure the requests of thisWebClient
.- Parameters:
requestConfigurer
- request configuration callback- Returns:
- new instance of
WebClientProvider
- Since:
- 4.3
-
getWebClientProvider
Deprecated.Creates aWebClientProvider
for the given configuration- Parameters:
clientConfiguration
- must not be null- Returns:
- the
WebClientProvider
- Since:
- 4.3
-