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.HttpClientbuild(HttpClientSettings settings) Build a newHttpClientinstance with the given settings applied.withHttpClientCustomizer(UnaryOperator<reactor.netty.http.client.HttpClient> customizer) Return a newReactorHttpClientBuilderthat applies additional customization to the underlyingHttpClient.withHttpClientFactory(Supplier<reactor.netty.http.client.HttpClient> factory) Return a newReactorHttpClientBuilderthat uses the given factory to create theHttpClient.withReactorResourceFactory(ReactorResourceFactory reactorResourceFactory) Return a newReactorHttpClientBuilderthat uses the givenReactorResourceFactoryto create theHttpClient.
-
Constructor Details
-
ReactorHttpClientBuilder
public ReactorHttpClientBuilder()
-
-
Method Details
-
withReactorResourceFactory
public ReactorHttpClientBuilder withReactorResourceFactory(ReactorResourceFactory reactorResourceFactory) Return a newReactorHttpClientBuilderthat uses the givenReactorResourceFactoryto create theHttpClient.- Parameters:
reactorResourceFactory- theReactorResourceFactoryto use- Returns:
- a new
ReactorHttpClientBuilderinstance
-
withHttpClientFactory
public ReactorHttpClientBuilder withHttpClientFactory(Supplier<reactor.netty.http.client.HttpClient> factory) Return a newReactorHttpClientBuilderthat uses the given factory to create theHttpClient.- Parameters:
factory- the factory to use- Returns:
- a new
ReactorHttpClientBuilderinstance
-
withHttpClientCustomizer
public ReactorHttpClientBuilder withHttpClientCustomizer(UnaryOperator<reactor.netty.http.client.HttpClient> customizer) Return a newReactorHttpClientBuilderthat applies additional customization to the underlyingHttpClient.- Parameters:
customizer- the customizer to apply- Returns:
- a new
ReactorHttpClientBuilderinstance
-
build
Build a newHttpClientinstance with the given settings applied.- Parameters:
settings- the settings to apply- Returns:
- a new
HttpClientinstance
-