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.CloseableHttpAsyncClientbuild(HttpClientSettings settings) Build a newHttpAsyncClientinstance with the given settings applied.withConnectionConfigCustomizer(Consumer<org.apache.hc.client5.http.config.ConnectionConfig.Builder> connectionConfigCustomizer) Return a newHttpComponentsHttpAsyncClientBuilderthat applies additional customization to the underlyingConnectionConfig.Builder.withConnectionManagerCustomizer(Consumer<org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManagerBuilder> connectionManagerCustomizer) Return a newHttpComponentsHttpAsyncClientBuilderthat applies additional customization to the underlyingPoolingAsyncClientConnectionManagerBuilder.withCustomizer(Consumer<org.apache.hc.client5.http.impl.async.HttpAsyncClientBuilder> customizer) Return a newHttpComponentsHttpAsyncClientBuilderthat applies additional customization to the underlyingHttpAsyncClientBuilder.withDefaultRequestConfigCustomizer(Consumer<org.apache.hc.client5.http.config.RequestConfig.Builder> defaultRequestConfigCustomizer) Return a newHttpComponentsHttpAsyncClientBuilderthat applies additional customization to the underlyingRequestConfig.Builderused for default requests.withTlsStrategyFactory(Function<SslBundle, org.apache.hc.core5.http.nio.ssl.TlsStrategy> tlsStrategyFactory) Return a newHttpComponentsHttpAsyncClientBuilderwith a replacementTlsStrategyfactory.
-
Constructor Details
-
HttpComponentsHttpAsyncClientBuilder
public HttpComponentsHttpAsyncClientBuilder()
-
-
Method Details
-
withCustomizer
public HttpComponentsHttpAsyncClientBuilder withCustomizer(Consumer<org.apache.hc.client5.http.impl.async.HttpAsyncClientBuilder> customizer) Return a newHttpComponentsHttpAsyncClientBuilderthat applies additional customization to the underlyingHttpAsyncClientBuilder.- Parameters:
customizer- the customizer to apply- Returns:
- a new
HttpComponentsHttpAsyncClientBuilderinstance
-
withConnectionManagerCustomizer
public HttpComponentsHttpAsyncClientBuilder withConnectionManagerCustomizer(Consumer<org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManagerBuilder> connectionManagerCustomizer) Return a newHttpComponentsHttpAsyncClientBuilderthat applies additional customization to the underlyingPoolingAsyncClientConnectionManagerBuilder.- Parameters:
connectionManagerCustomizer- the customizer to apply- Returns:
- a new
HttpComponentsHttpAsyncClientBuilderinstance
-
withConnectionConfigCustomizer
public HttpComponentsHttpAsyncClientBuilder withConnectionConfigCustomizer(Consumer<org.apache.hc.client5.http.config.ConnectionConfig.Builder> connectionConfigCustomizer) Return a newHttpComponentsHttpAsyncClientBuilderthat applies additional customization to the underlyingConnectionConfig.Builder.- Parameters:
connectionConfigCustomizer- the customizer to apply- Returns:
- a new
HttpComponentsHttpAsyncClientBuilderinstance
-
withTlsStrategyFactory
public HttpComponentsHttpAsyncClientBuilder withTlsStrategyFactory(Function<SslBundle, org.apache.hc.core5.http.nio.ssl.TlsStrategy> tlsStrategyFactory) Return a newHttpComponentsHttpAsyncClientBuilderwith a replacementTlsStrategyfactory.- Parameters:
tlsStrategyFactory- the new factory used to create aTlsStrategyfor a givenSslBundle- Returns:
- a new
HttpComponentsHttpAsyncClientBuilderinstance
-
withDefaultRequestConfigCustomizer
public HttpComponentsHttpAsyncClientBuilder withDefaultRequestConfigCustomizer(Consumer<org.apache.hc.client5.http.config.RequestConfig.Builder> defaultRequestConfigCustomizer) Return a newHttpComponentsHttpAsyncClientBuilderthat applies additional customization to the underlyingRequestConfig.Builderused for default requests.- Parameters:
defaultRequestConfigCustomizer- the customizer to apply- Returns:
- a new
HttpComponentsHttpAsyncClientBuilderinstance
-
build
public org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient build(HttpClientSettings settings) Build a newHttpAsyncClientinstance with the given settings applied.- Parameters:
settings- the settings to apply- Returns:
- a new
CloseableHttpAsyncClientinstance
-