Top Description Inners Fields Constructors Methods
reactor.netty.http.client

public final Class HttpClientConfig

extends ClientTransportConfig<HttpClientConfig>
Class Inheritance
Imports
java.net.SocketAddress, .URI, java.nio.charset.Charset, java.time.Duration, java.util.Map, .Objects, java.util.concurrent.TimeUnit, java.util.function.BiConsumer, .BiFunction, .BiPredicate, .Consumer, .Function, .Supplier, java.util.regex.Pattern, io.netty.channel.Channel, .ChannelHandler, .ChannelHandlerAdapter, .ChannelHandlerContext, .ChannelInboundHandlerAdapter, .ChannelInitializer, .ChannelOption, .ChannelPipeline, io.netty.handler.codec.http.DefaultHttpHeaders, .HttpClientCodec, .HttpClientUpgradeHandler, .HttpContentDecompressor, .HttpHeaders, .HttpMethod, .HttpResponse, .HttpResponseStatus, .LastHttpContent, io.netty.handler.codec.http.cookie.ClientCookieDecoder, .ClientCookieEncoder, io.netty.handler.codec.http2.Http2ClientUpgradeCodec, .Http2FrameCodec, .Http2FrameCodecBuilder, .Http2FrameLogger, .Http2MultiplexHandler, .Http2Settings, .Http2StreamFrameToHttpObjectCodec, io.netty.handler.flush.FlushConsolidationHandler, io.netty.handler.logging.LogLevel, .LoggingHandler, io.netty.handler.ssl.ApplicationProtocolNames, .SslHandler, io.netty.handler.timeout.ReadTimeoutHandler, io.netty.resolver.AddressResolverGroup, io.netty.util.ReferenceCountUtil, org.reactivestreams.Publisher, reactor.core.publisher.Mono, reactor.netty.ChannelPipelineConfigurer, .Connection, .ConnectionObserver, .NettyOutbound, .NettyPipeline, .ReactorNetty, reactor.netty.channel.ChannelMetricsRecorder, .ChannelOperations, reactor.netty.http.Http2SettingsSpec, .HttpProtocol, .HttpResources, reactor.netty.http.logging.HttpMessageLogFactory, .ReactorNettyHttpMessageLogFactory, reactor.netty.resources.ConnectionProvider, .LoopResources, reactor.netty.tcp.SslProvider, reactor.netty.transport.ClientTransportConfig, .ProxyProvider, reactor.netty.transport.logging.AdvancedByteBufFormat, reactor.util.Logger, .Loggers, reactor.util.annotation.Nullable, reactor.util.context.Context

Encapsulate all necessary configuration for HTTP client transport. The public API is read-only.
Authors
Stephane Maldini, Violeta Georgieva

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class
pack-priv static class
HttpClientConfig.H2InboundStreamHandler

Handle inbound streams (server pushes).

pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv boolean
pack-priv String
pack-priv BiFunction<? super HttpClientRequest, ? super NettyOutbound, ? extends Publisher<Void>>
pack-priv Function<? super Mono<? extends Connection>, ? extends Mono<? extends Connection>>
pack-priv ClientCookieDecoder
pack-priv ClientCookieEncoder
pack-priv HttpResponseDecoderSpec
pack-priv Function<Mono<HttpClientConfig>, Mono<HttpClientConfig>>
pack-priv BiConsumer<? super HttpClientRequest, ? super Connection>
pack-priv BiConsumer<? super HttpClientResponse, ? super Connection>
pack-priv BiConsumer<? super HttpClientResponse, ? super Connection>
pack-priv BiConsumer<? super HttpClientRequest, ? super Connection>
pack-priv BiConsumer<? super HttpClientRequest, ? super Throwable>
pack-priv BiConsumer<? super HttpClientResponse, ? super Connection>
pack-priv BiConsumer<? super HttpClientResponse, ? super Throwable>
pack-priv static final Pattern
pack-priv static final BiPredicate<HttpClientRequest, HttpClientResponse>
pack-priv BiPredicate<HttpClientRequest, HttpClientResponse>
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv HttpHeaders
pack-priv static final Http2StreamFrameToHttpObjectCodec
pack-priv Http2SettingsSpec
pack-priv static final Http2StreamBridgeClientHandler
pack-priv HttpMessageLogFactory
pack-priv static final Logger
pack-priv static final LoggingHandler
pack-priv HttpMethod
pack-priv HttpProtocol[]
pack-priv BiConsumer<HttpHeaders, HttpClientRequest>
pack-priv Consumer<HttpClientRequest>
pack-priv Duration
pack-priv boolean
pack-priv static final boolean
SSL_DEBUG

Default value whether the SSL debugging on the client side will be enabled/disabled, fallback to SSL debugging disabled.

pack-priv SslProvider
pack-priv URI
pack-priv String
pack-priv Function<String, String>
pack-priv WebsocketClientSpec

Constructor Summary

AccessConstructor and Description
pack-priv
HttpClientConfig(HttpConnectionProvider connectionProvider, Map<ChannelOption<?>, ?> options, Supplier<? extends SocketAddress> remoteAddress)

pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
addStreamHandlers(Channel ch, ConnectionObserver obs, ChannelOperations.OnSetup opsFactory, boolean acceptGzip, ChannelMetricsRecorder metricsRecorder, long responseTimeoutMillis, Function<String, String> uriTagValue)

public String

Returns:

the configured base URL to use for this request/response or null
baseUrl
()

Return the configured base URL to use for this request/response or null.

public int
public ChannelOperations.OnSetup
channelOperationsProvider()

Overrides reactor.netty.transport.TransportConfig.channelOperationsProvider.

Return the associated ChannelOperations.OnSetup, config implementations might override this.
pack-priv boolean
checkProtocol(int protocol)

pack-priv static void
pack-priv static void
configureHttp11Pipeline(ChannelPipeline p, boolean acceptGzip, HttpResponseDecoderSpec decoder, ChannelMetricsRecorder metricsRecorder, Function<String, String> uriTagValue)

pack-priv static void
configureHttp2Pipeline(ChannelPipeline p, boolean acceptGzip, HttpResponseDecoderSpec decoder, Http2Settings http2Settings, ConnectionObserver observer)

public ConnectionProvider
public ClientCookieDecoder

Returns:

the configured ClientCookieDecoder or the default ClientCookieDecoder#STRICT
cookieDecoder
()

Deprecated as of 1.1.0. This will be removed in 2.0.0 as Netty 5 supports only strict validation.
Return the configured ClientCookieDecoder or the default ClientCookieDecoder#STRICT.
public ClientCookieEncoder

Returns:

the configured ClientCookieEncoder or the default ClientCookieEncoder#STRICT
cookieEncoder
()

Deprecated as of 1.1.0. This will be removed in 2.0.0 as Netty 5 supports only strict validation.
Return the configured ClientCookieEncoder or the default ClientCookieEncoder#STRICT.
public HttpResponseDecoderSpec

Returns:

the configured HTTP request decoder options or the default
decoder
()

Return the configured HTTP response decoder options or the default.

public AddressResolverGroup<?>

Returns:

the global AddressResolverGroup
defaultAddressResolverGroup
()

Implements abstract reactor.netty.transport.ClientTransportConfig.defaultAddressResolverGroup.

Provides a global AddressResolverGroup from HttpResources that is shared amongst all HTTP clients.
protected ConnectionObserver
protected LoggingHandler
defaultLoggingHandler()

Implements abstract reactor.netty.transport.TransportConfig.defaultLoggingHandler.

Return the default LoggingHandler to wiretap this transport.
protected LoopResources
defaultLoopResources()

Implements abstract reactor.netty.transport.TransportConfig.defaultLoopResources.

Return the default LoopResources for this transport.
protected ChannelMetricsRecorder
defaultMetricsRecorder()

Implements abstract reactor.netty.transport.TransportConfig.defaultMetricsRecorder.

Return the configured metrics recorder.
protected ChannelPipelineConfigurer
pack-priv void
public BiPredicate<HttpClientRequest, HttpClientResponse>

Returns:

the configured follow redirect predicate or null
followRedirectPredicate
()

Return the configured follow redirect predicate or null.

public HttpHeaders

Returns:

a copy of the request headers
headers
()

Return a copy of the request headers.

pack-priv Http2Settings
public Http2SettingsSpec

Returns:

the HTTP/2 configuration
http2SettingsSpec
()

Return the HTTP/2 configuration.

pack-priv HttpConnectionProvider
public boolean

Returns:

whether GZip compression is enabled
isAcceptGzip
()

Return whether GZip compression is enabled.

public boolean

Returns:

true if retry once is disabled, false otherwise
isRetryDisabled
()

Return true if retry once is disabled, false otherwise.

public boolean

Returns:

true if that HttpClient secured via SSL transport
isSecure
()

Returns true if that HttpClient secured via SSL transport.

protected void
public HttpMethod

Returns:

the configured request method
method
()

Return the configured request method.

protected void
metricsRecorder(Supplier<? extends ChannelMetricsRecorder>
a supplier for the ChannelMetricsRecorder
metricsRecorder
)

Overrides reactor.netty.transport.TransportConfig.metricsRecorder.

Obtains immediately the ChannelMetricsRecorder from the provided Supplier.
public HttpProtocol[]

Returns:

the HTTP protocol to support
protocols
()

Return the HTTP protocol to support.

pack-priv void
protocols(HttpProtocol... protocols)

protected void
public BiConsumer<HttpHeaders, HttpClientRequest>

Returns:

the configured redirect request BiConsumer or null
redirectRequestBiConsumer
()

Return the configured redirect request BiConsumer or null.

public Consumer<HttpClientRequest>

Returns:

the configured redirect request consumer or null
redirectRequestConsumer
()

Return the configured redirect request consumer or null.

protected AddressResolverGroup<?>
public Duration

Returns:

the configured response timeout or null
responseTimeout
()

Return the configured response timeout or null.

public SslProvider

Returns:

the current SslProvider if that HttpClient secured via SSL transport or null
sslProvider
()

Returns the current SslProvider if that HttpClient secured via SSL transport or null.

public String

Returns:

the configured request uri
uri
()

Return the configured request uri.

public Function<String, String>

Returns:

the configured function that receives the actual uri and returns the uri tag value that will be used for the metrics with reactor.netty.Metrics#URI tag
uriTagValue
()

Returns the configured function that receives the actual uri and returns the uri tag value that will be used for the metrics with reactor.netty.Metrics#URI tag.

public WebsocketClientSpec

Returns:

the configured websocket client configuration
websocketClientSpec
()

Return the configured websocket client configuration.

Inherited from reactor.netty.transport.ClientTransportConfig:
channelTypedoOnConnectdoOnConnecteddoOnDisconnectedeventLoopGroupgetNameResolverProviderhasProxyproxyProviderremoteAddressresolver