Class HttpAsyncClients
java.lang.Object
org.apache.hc.client5.http.impl.async.HttpAsyncClients
Factory methods for
CloseableHttpAsyncClient instances.- Since:
- 5.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CloseableHttpClientclassic(CloseableHttpAsyncClient client, org.apache.hc.core5.util.Timeout operationTimeout) Creates anCloseableHttpClientfacade backed byCloseableHttpAsyncClientbuilt internally and acting as a compatibility bridge between the classic APIs based on the standardInputStream/OutputStreammodel and the underlying asynchronous message transport.static CloseableHttpAsyncClientCreatesCloseableHttpAsyncClientinstance with default configuration.static CloseableHttpAsyncClientCreates HTTP/2CloseableHttpAsyncClientinstance with default configuration optimized for HTTP/2 protocol and message multiplexing.static MinimalH2AsyncClientCreatesMinimalH2AsyncClientinstance optimized for HTTP/2 multiplexing message transport without advanced HTTP protocol functionality.static MinimalH2AsyncClientcreateHttp2Minimal(org.apache.hc.core5.http2.config.H2Config h2Config) CreatesMinimalH2AsyncClientinstance optimized for HTTP/2 multiplexing message transport without advanced HTTP protocol functionality.static MinimalH2AsyncClientcreateHttp2Minimal(org.apache.hc.core5.http2.config.H2Config h2Config, org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig) CreatesMinimalH2AsyncClientinstance optimized for HTTP/2 multiplexing message transport without advanced HTTP protocol functionality.static MinimalH2AsyncClientcreateHttp2Minimal(org.apache.hc.core5.http2.config.H2Config h2Config, org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig, DnsResolver dnsResolver, org.apache.hc.core5.http.nio.ssl.TlsStrategy tlsStrategy) CreatesMinimalH2AsyncClientinstance optimized for HTTP/2 multiplexing message transport without advanced HTTP protocol functionality.static MinimalH2AsyncClientcreateHttp2Minimal(org.apache.hc.core5.http2.config.H2Config h2Config, org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig, org.apache.hc.core5.http.nio.ssl.TlsStrategy tlsStrategy) CreatesMinimalH2AsyncClientinstance optimized for HTTP/2 multiplexing message transport without advanced HTTP protocol functionality.static CloseableHttpAsyncClientCreates HTTP/2CloseableHttpAsyncClientinstance with default configuration and system properties optimized for HTTP/2 protocol and message multiplexing.static MinimalHttpAsyncClientCreatesMinimalHttpAsyncClientinstance optimized for HTTP/1.1 and HTTP/2 message transport without advanced HTTP protocol functionality.static MinimalHttpAsyncClientcreateMinimal(AsyncClientConnectionManager connManager) CreatesMinimalHttpAsyncClientinstance optimized for HTTP/1.1 and HTTP/2 message transport without advanced HTTP protocol functionality.static MinimalHttpAsyncClientcreateMinimal(org.apache.hc.core5.http2.config.H2Config h2Config, org.apache.hc.core5.http.config.Http1Config h1Config) CreatesMinimalHttpAsyncClientinstance optimized for HTTP/1.1 and HTTP/2 message transport without advanced HTTP protocol functionality.static MinimalHttpAsyncClientcreateMinimal(org.apache.hc.core5.http2.config.H2Config h2Config, org.apache.hc.core5.http.config.Http1Config h1Config, org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig) CreatesMinimalHttpAsyncClientinstance optimized for HTTP/1.1 and HTTP/2 message transport without advanced HTTP protocol functionality.static MinimalHttpAsyncClientcreateMinimal(org.apache.hc.core5.http2.config.H2Config h2Config, org.apache.hc.core5.http.config.Http1Config h1Config, org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig, AsyncClientConnectionManager connmgr) CreatesMinimalHttpAsyncClientinstance optimized for HTTP/1.1 and HTTP/2 message transport without advanced HTTP protocol functionality.static MinimalHttpAsyncClientcreateMinimal(org.apache.hc.core5.http2.HttpVersionPolicy versionPolicy, org.apache.hc.core5.http2.config.H2Config h2Config, org.apache.hc.core5.http.config.Http1Config h1Config, org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig) Deprecated.static MinimalHttpAsyncClientcreateMinimal(org.apache.hc.core5.http2.HttpVersionPolicy versionPolicy, org.apache.hc.core5.http2.config.H2Config h2Config, org.apache.hc.core5.http.config.Http1Config h1Config, org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig, AsyncClientConnectionManager connmgr) private static MinimalH2AsyncClientcreateMinimalHttp2AsyncClientImpl(org.apache.hc.core5.reactor.IOEventHandlerFactory eventHandlerFactory, AsyncPushConsumerRegistry pushConsumerRegistry, org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig, DnsResolver dnsResolver, org.apache.hc.core5.http.nio.ssl.TlsStrategy tlsStrategy) private static MinimalHttpAsyncClientcreateMinimalHttpAsyncClientImpl(org.apache.hc.core5.reactor.IOEventHandlerFactory eventHandlerFactory, AsyncPushConsumerRegistry pushConsumerRegistry, org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig, AsyncClientConnectionManager connmgr, SchemePortResolver schemePortResolver, TlsConfig tlsConfig) private static org.apache.hc.core5.http.protocol.HttpProcessorstatic CloseableHttpAsyncClientCreatesCloseableHttpAsyncClientinstance with default configuration and system properties.static HttpAsyncClientBuildercustom()Creates builder object for construction of customCloseableHttpAsyncClientinstances.static H2AsyncClientBuilderCreates builder object for construction of custom HTTP/2CloseableHttpAsyncClientinstances optimized for HTTP/2 protocol and message multiplexingstatic org.apache.hc.core5.http.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushRouter(org.apache.hc.core5.http.impl.routing.RequestRouter<org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncPushConsumer>> requestRouter) CreatesHandlerFactorybacked by a pushRequestRouter.
-
Constructor Details
-
HttpAsyncClients
private HttpAsyncClients()
-
-
Method Details
-
custom
Creates builder object for construction of customCloseableHttpAsyncClientinstances. -
createDefault
CreatesCloseableHttpAsyncClientinstance with default configuration. -
createSystem
CreatesCloseableHttpAsyncClientinstance with default configuration and system properties. -
customHttp2
Creates builder object for construction of custom HTTP/2CloseableHttpAsyncClientinstances optimized for HTTP/2 protocol and message multiplexing -
createHttp2Default
Creates HTTP/2CloseableHttpAsyncClientinstance with default configuration optimized for HTTP/2 protocol and message multiplexing. -
createHttp2System
Creates HTTP/2CloseableHttpAsyncClientinstance with default configuration and system properties optimized for HTTP/2 protocol and message multiplexing. -
createMinimalProtocolProcessor
private static org.apache.hc.core5.http.protocol.HttpProcessor createMinimalProtocolProcessor() -
createMinimalHttpAsyncClientImpl
private static MinimalHttpAsyncClient createMinimalHttpAsyncClientImpl(org.apache.hc.core5.reactor.IOEventHandlerFactory eventHandlerFactory, AsyncPushConsumerRegistry pushConsumerRegistry, org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig, AsyncClientConnectionManager connmgr, SchemePortResolver schemePortResolver, TlsConfig tlsConfig) -
createMinimal
@Deprecated public static MinimalHttpAsyncClient createMinimal(org.apache.hc.core5.http2.HttpVersionPolicy versionPolicy, org.apache.hc.core5.http2.config.H2Config h2Config, org.apache.hc.core5.http.config.Http1Config h1Config, org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig, AsyncClientConnectionManager connmgr) CreatesMinimalHttpAsyncClientinstance optimized for HTTP/1.1 and HTTP/2 message transport without advanced HTTP protocol functionality. -
createMinimal
public static MinimalHttpAsyncClient createMinimal(org.apache.hc.core5.http2.config.H2Config h2Config, org.apache.hc.core5.http.config.Http1Config h1Config, org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig, AsyncClientConnectionManager connmgr) CreatesMinimalHttpAsyncClientinstance optimized for HTTP/1.1 and HTTP/2 message transport without advanced HTTP protocol functionality.- Since:
- 5.2
-
createMinimal
@Deprecated public static MinimalHttpAsyncClient createMinimal(org.apache.hc.core5.http2.HttpVersionPolicy versionPolicy, org.apache.hc.core5.http2.config.H2Config h2Config, org.apache.hc.core5.http.config.Http1Config h1Config, org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig) Deprecated.CreatesMinimalHttpAsyncClientinstance optimized for HTTP/1.1 and HTTP/2 message transport without advanced HTTP protocol functionality. -
createMinimal
public static MinimalHttpAsyncClient createMinimal(org.apache.hc.core5.http2.config.H2Config h2Config, org.apache.hc.core5.http.config.Http1Config h1Config, org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig) CreatesMinimalHttpAsyncClientinstance optimized for HTTP/1.1 and HTTP/2 message transport without advanced HTTP protocol functionality. -
createMinimal
public static MinimalHttpAsyncClient createMinimal(org.apache.hc.core5.http2.config.H2Config h2Config, org.apache.hc.core5.http.config.Http1Config h1Config) CreatesMinimalHttpAsyncClientinstance optimized for HTTP/1.1 and HTTP/2 message transport without advanced HTTP protocol functionality. -
createMinimal
CreatesMinimalHttpAsyncClientinstance optimized for HTTP/1.1 and HTTP/2 message transport without advanced HTTP protocol functionality. -
createMinimal
CreatesMinimalHttpAsyncClientinstance optimized for HTTP/1.1 and HTTP/2 message transport without advanced HTTP protocol functionality. -
createMinimalHttp2AsyncClientImpl
private static MinimalH2AsyncClient createMinimalHttp2AsyncClientImpl(org.apache.hc.core5.reactor.IOEventHandlerFactory eventHandlerFactory, AsyncPushConsumerRegistry pushConsumerRegistry, org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig, DnsResolver dnsResolver, org.apache.hc.core5.http.nio.ssl.TlsStrategy tlsStrategy) -
createHttp2Minimal
public static MinimalH2AsyncClient createHttp2Minimal(org.apache.hc.core5.http2.config.H2Config h2Config, org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig, DnsResolver dnsResolver, org.apache.hc.core5.http.nio.ssl.TlsStrategy tlsStrategy) CreatesMinimalH2AsyncClientinstance optimized for HTTP/2 multiplexing message transport without advanced HTTP protocol functionality. -
createHttp2Minimal
public static MinimalH2AsyncClient createHttp2Minimal(org.apache.hc.core5.http2.config.H2Config h2Config, org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig, org.apache.hc.core5.http.nio.ssl.TlsStrategy tlsStrategy) CreatesMinimalH2AsyncClientinstance optimized for HTTP/2 multiplexing message transport without advanced HTTP protocol functionality. -
createHttp2Minimal
public static MinimalH2AsyncClient createHttp2Minimal(org.apache.hc.core5.http2.config.H2Config h2Config, org.apache.hc.core5.reactor.IOReactorConfig ioReactorConfig) CreatesMinimalH2AsyncClientinstance optimized for HTTP/2 multiplexing message transport without advanced HTTP protocol functionality. -
createHttp2Minimal
public static MinimalH2AsyncClient createHttp2Minimal(org.apache.hc.core5.http2.config.H2Config h2Config) CreatesMinimalH2AsyncClientinstance optimized for HTTP/2 multiplexing message transport without advanced HTTP protocol functionality. -
createHttp2Minimal
CreatesMinimalH2AsyncClientinstance optimized for HTTP/2 multiplexing message transport without advanced HTTP protocol functionality. -
pushRouter
public static org.apache.hc.core5.http.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushRouter(org.apache.hc.core5.http.impl.routing.RequestRouter<org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncPushConsumer>> requestRouter) CreatesHandlerFactorybacked by a pushRequestRouter.- Since:
- 5.4
-
classic
@Experimental public static CloseableHttpClient classic(CloseableHttpAsyncClient client, org.apache.hc.core5.util.Timeout operationTimeout) Creates anCloseableHttpClientfacade backed byCloseableHttpAsyncClientbuilt internally and acting as a compatibility bridge between the classic APIs based on the standardInputStream/OutputStreammodel and the underlying asynchronous message transport.This feature is considered experimental and may be discontinued in the future.
- Parameters:
client- async clientoperationTimeout- maximum period an operation can block awaiting input / output.- Since:
- 5.5
-
createMinimal(H2Config, Http1Config, IOReactorConfig)