Class HttpComponentsHttpAsyncClientBuilder
java.lang.Object
org.springframework.boot.http.client.HttpComponentsHttpAsyncClientBuilder
Builder that can be used to create a
Apache HttpComponents
HttpAsyncClient
.- Since:
- 3.5.0
- Author:
- Phillip Webb, Andy Wilkinson, Scott Frederick
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient
build
(HttpClientSettings settings) Build a newHttpAsyncClient
instance with the given settings applied.withConnectionConfigCustomizer
(Consumer<org.apache.hc.client5.http.config.ConnectionConfig.Builder> connectionConfigCustomizer) Return a newHttpComponentsHttpAsyncClientBuilder
that applies additional customization to the underlyingConnectionConfig.Builder
.withConnectionManagerCustomizer
(Consumer<org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManagerBuilder> connectionManagerCustomizer) Return a newHttpComponentsHttpAsyncClientBuilder
that applies additional customization to the underlyingPoolingAsyncClientConnectionManagerBuilder
.withCustomizer
(Consumer<org.apache.hc.client5.http.impl.async.HttpAsyncClientBuilder> customizer) Return a newHttpComponentsHttpAsyncClientBuilder
that applies additional customization to the underlyingHttpAsyncClientBuilder
.withDefaultRequestConfigCustomizer
(Consumer<org.apache.hc.client5.http.config.RequestConfig.Builder> defaultRequestConfigCustomizer) Return a newHttpComponentsHttpAsyncClientBuilder
that applies additional customization to the underlyingRequestConfig.Builder
used for default requests.withTlsStrategyFactory
(Function<SslBundle, org.apache.hc.core5.http.nio.ssl.TlsStrategy> tlsStrategyFactory) Return a newHttpComponentsHttpAsyncClientBuilder
with a replacementTlsStrategy
factory.
-
Constructor Details
-
HttpComponentsHttpAsyncClientBuilder
public HttpComponentsHttpAsyncClientBuilder()
-
-
Method Details
-
withCustomizer
public HttpComponentsHttpAsyncClientBuilder withCustomizer(Consumer<org.apache.hc.client5.http.impl.async.HttpAsyncClientBuilder> customizer) Return a newHttpComponentsHttpAsyncClientBuilder
that applies additional customization to the underlyingHttpAsyncClientBuilder
.- Parameters:
customizer
- the customizer to apply- Returns:
- a new
HttpComponentsHttpAsyncClientBuilder
instance
-
withConnectionManagerCustomizer
public HttpComponentsHttpAsyncClientBuilder withConnectionManagerCustomizer(Consumer<org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManagerBuilder> connectionManagerCustomizer) Return a newHttpComponentsHttpAsyncClientBuilder
that applies additional customization to the underlyingPoolingAsyncClientConnectionManagerBuilder
.- Parameters:
connectionManagerCustomizer
- the customizer to apply- Returns:
- a new
HttpComponentsHttpAsyncClientBuilder
instance
-
withConnectionConfigCustomizer
public HttpComponentsHttpAsyncClientBuilder withConnectionConfigCustomizer(Consumer<org.apache.hc.client5.http.config.ConnectionConfig.Builder> connectionConfigCustomizer) Return a newHttpComponentsHttpAsyncClientBuilder
that applies additional customization to the underlyingConnectionConfig.Builder
.- Parameters:
connectionConfigCustomizer
- the customizer to apply- Returns:
- a new
HttpComponentsHttpAsyncClientBuilder
instance
-
withTlsStrategyFactory
public HttpComponentsHttpAsyncClientBuilder withTlsStrategyFactory(Function<SslBundle, org.apache.hc.core5.http.nio.ssl.TlsStrategy> tlsStrategyFactory) Return a newHttpComponentsHttpAsyncClientBuilder
with a replacementTlsStrategy
factory.- Parameters:
tlsStrategyFactory
- the new factory used to create aTlsStrategy
for a givenSslBundle
- Returns:
- a new
HttpComponentsHttpAsyncClientBuilder
instance
-
withDefaultRequestConfigCustomizer
public HttpComponentsHttpAsyncClientBuilder withDefaultRequestConfigCustomizer(Consumer<org.apache.hc.client5.http.config.RequestConfig.Builder> defaultRequestConfigCustomizer) Return a newHttpComponentsHttpAsyncClientBuilder
that applies additional customization to the underlyingRequestConfig.Builder
used for default requests.- Parameters:
defaultRequestConfigCustomizer
- the customizer to apply- Returns:
- a new
HttpComponentsHttpAsyncClientBuilder
instance
-
build
public org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient build(HttpClientSettings settings) Build a newHttpAsyncClient
instance with the given settings applied.- Parameters:
settings
- the settings to apply- Returns:
- a new
CloseableHttpAsyncClient
instance
-