Class ReactorHttpClientBuilder
java.lang.Object
org.springframework.boot.http.client.ReactorHttpClientBuilder
Builder that can be used to create a Rector Netty
HttpClient
.- Since:
- 3.5.0
- Author:
- Phillip Webb, Andy Wilkinson, Scott Frederick
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionreactor.netty.http.client.HttpClient
build
(HttpClientSettings settings) Build a newHttpClient
instance with the given settings applied.withHttpClientCustomizer
(UnaryOperator<reactor.netty.http.client.HttpClient> customizer) Return a newReactorHttpClientBuilder
that applies additional customization to the underlyingHttpClient
.withHttpClientFactory
(Supplier<reactor.netty.http.client.HttpClient> factory) Return a newReactorHttpClientBuilder
that uses the given factory to create theHttpClient
.withReactorResourceFactory
(ReactorResourceFactory reactorResourceFactory) Return a newReactorHttpClientBuilder
that uses the givenReactorResourceFactory
to create theHttpClient
.
-
Constructor Details
-
ReactorHttpClientBuilder
public ReactorHttpClientBuilder()
-
-
Method Details
-
withReactorResourceFactory
public ReactorHttpClientBuilder withReactorResourceFactory(ReactorResourceFactory reactorResourceFactory) Return a newReactorHttpClientBuilder
that uses the givenReactorResourceFactory
to create theHttpClient
.- Parameters:
reactorResourceFactory
- theReactorResourceFactory
to use- Returns:
- a new
ReactorHttpClientBuilder
instance
-
withHttpClientFactory
public ReactorHttpClientBuilder withHttpClientFactory(Supplier<reactor.netty.http.client.HttpClient> factory) Return a newReactorHttpClientBuilder
that uses the given factory to create theHttpClient
.- Parameters:
factory
- the factory to use- Returns:
- a new
ReactorHttpClientBuilder
instance
-
withHttpClientCustomizer
public ReactorHttpClientBuilder withHttpClientCustomizer(UnaryOperator<reactor.netty.http.client.HttpClient> customizer) Return a newReactorHttpClientBuilder
that applies additional customization to the underlyingHttpClient
.- Parameters:
customizer
- the customizer to apply- Returns:
- a new
ReactorHttpClientBuilder
instance
-
build
Build a newHttpClient
instance with the given settings applied.- Parameters:
settings
- the settings to apply- Returns:
- a new
HttpClient
instance
-