Package reactor.netty.http.client
Class HttpClientConfig
java.lang.Object
reactor.netty.transport.TransportConfig
reactor.netty.transport.ClientTransportConfig<HttpClientConfig>
reactor.netty.http.client.HttpClientConfig
Encapsulate all necessary configuration for HTTP client transport. The public API is read-only.
- Author:
- Stephane Maldini, Violeta Georgieva
-
Method Summary
Modifier and TypeMethodDescription@Nullable StringbaseUrl()Return the configured base URL to use for this request/response or null.protected voidbindAddress(Supplier<? extends SocketAddress> bindAddressSupplier) intchannelInitializer(ConnectionObserver connectionObserver, @Nullable SocketAddress remoteAddress, boolean onServer) channelType(boolean isDomainSocket) Deprecated.as of 1.1.0.Deprecated.as of 1.1.0.decoder()Return the configured HTTP response decoder options or the default.Provides a globalAddressResolverGroupfromHttpResourcesthat is shared amongst all HTTP clients.protected ConnectionObserverprotected LoggingHandlerprotected LoopResourcesprotected ChannelMetricsRecorderprotected ChannelPipelineConfigurer@Nullable BiPredicate<HttpClientRequest,HttpClientResponse> Return the configured follow redirect predicate or null.headers()Return a copy of the request headers.@Nullable Http2SettingsSpecReturn the HTTP/2 configuration.@Nullable Http3SettingsSpecReturn the HTTP/3 configuration.booleanReturn whether Brotli compression is enabled.booleanReturn whether GZip compression is enabled.booleanReturn true ifretry onceis disabled, false otherwise.booleanisSecure()Returns true if thatHttpClientsecured via SSL transport.protected voidloggingHandler(LoggingHandler loggingHandler) method()Return the configured request method.protected voidmetricsRecorder(@Nullable Supplier<? extends ChannelMetricsRecorder> metricsRecorder) Return the HTTP protocol to support.protected voidproxyProvider(ProxyProvider proxyProvider) protected voidproxyProviderSupplier(Supplier<ProxyProvider> proxyProviderSupplier) @Nullable BiConsumer<HttpHeaders,HttpClientRequest> Return the configured redirect requestBiConsumeror null.@Nullable Consumer<HttpClientRequest>Return the configured redirect request consumer or null.protected AddressResolverGroup<?>@Nullable DurationReturn the configured response timeout or null.@Nullable SslProviderReturns the currentSslProviderif thatHttpClientsecured via SSL transport or null.@Nullable Stringuri()Return the configured request uri.Returns the configured function that receives the actual uri and returns the uri tag value that will be used for the metrics withMetrics.URItag.@Nullable WebsocketClientSpecReturn the configured websocket client configuration.Methods inherited from class reactor.netty.transport.ClientTransportConfig
doOnConnect, doOnConnected, doOnDisconnected, eventLoopGroup, getNameResolverProvider, hasProxy, proxyProvider, proxyProviderSupplier, remoteAddress, resolverMethods inherited from class reactor.netty.transport.TransportConfig
attributes, bindAddress, channelGroup, connectionFactory, connectionObserver, doOnChannelInit, isPreferNative, loggingHandler, loopResources, metricsRecorder, metricsRecorderInternal, options, updateMap
-
Method Details
-
baseUrl
Return the configured base URL to use for this request/response or null.- Returns:
- the configured base URL to use for this request/response or null
-
channelHash
public int channelHash()- Overrides:
channelHashin classClientTransportConfig<HttpClientConfig>
-
channelOperationsProvider
- Overrides:
channelOperationsProviderin classTransportConfig
-
connectionProvider
- Overrides:
connectionProviderin classClientTransportConfig<HttpClientConfig>
-
cookieDecoder
Deprecated.as of 1.1.0. This will be removed in 2.0.0 as Netty 5 supports only strict validation.Return the configuredClientCookieDecoderor the defaultClientCookieDecoder.STRICT.- Returns:
- the configured
ClientCookieDecoderor the defaultClientCookieDecoder.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 configuredClientCookieEncoderor the defaultClientCookieEncoder.STRICT.- Returns:
- the configured
ClientCookieEncoderor the defaultClientCookieEncoder.STRICT
-
decoder
Return the configured HTTP response decoder options or the default.- Returns:
- the configured HTTP request decoder options or the default
-
followRedirectPredicate
Return the configured follow redirect predicate or null.- Returns:
- the configured follow redirect predicate or null
-
headers
Return a copy of the request headers.- Returns:
- a copy of the request headers
-
http2SettingsSpec
Return the HTTP/2 configuration.- Returns:
- the HTTP/2 configuration
-
http3SettingsSpec
Return the HTTP/3 configuration.- Returns:
- the HTTP/3 configuration
- Since:
- 1.2.0
-
isAcceptBrotli
public boolean isAcceptBrotli()Return whether Brotli compression is enabled.- Returns:
- whether Brotli compression is enabled
-
isAcceptGzip
public boolean isAcceptGzip()Return whether GZip compression is enabled.- Returns:
- whether GZip compression is enabled
-
isRetryDisabled
public boolean isRetryDisabled()Return true ifretry onceis disabled, false otherwise.- Returns:
- true if
retry onceis disabled, false otherwise
-
isSecure
public boolean isSecure()Returns true if thatHttpClientsecured via SSL transport.- Returns:
- true if that
HttpClientsecured via SSL transport
-
method
Return the configured request method.- Returns:
- the configured request method
-
protocols
Return the HTTP protocol to support. Default isHttpProtocol.HTTP11.- Returns:
- the HTTP protocol to support
-
redirectRequestBiConsumer
Return the configured redirect requestBiConsumeror null.- Returns:
- the configured redirect request
BiConsumeror null
-
redirectRequestConsumer
Return the configured redirect request consumer or null.- Returns:
- the configured redirect request consumer or null
-
responseTimeout
Return the configured response timeout or null.- Returns:
- the configured response timeout or null
-
sslProvider
Returns the currentSslProviderif thatHttpClientsecured via SSL transport or null.- Returns:
- the current
SslProviderif thatHttpClientsecured via SSL transport or null
-
uri
Return the configured request uri.- Returns:
- the configured request uri
-
uriTagValue
Returns the configured function that receives the actual uri and returns the uri tag value that will be used for the metrics withMetrics.URItag.- Returns:
- the configured function that receives the actual uri and returns the uri tag value
that will be used for the metrics with
Metrics.URItag
-
websocketClientSpec
Return the configured websocket client configuration.- Returns:
- the configured websocket client configuration
-
channelInitializer
public ChannelInitializer<Channel> channelInitializer(ConnectionObserver connectionObserver, @Nullable SocketAddress remoteAddress, boolean onServer) - Overrides:
channelInitializerin classTransportConfig
-
defaultAddressResolverGroup
Provides a globalAddressResolverGroupfromHttpResourcesthat is shared amongst all HTTP clients.AddressResolverGroupuses the globalLoopResourcesfromHttpResources.- Specified by:
defaultAddressResolverGroupin classClientTransportConfig<HttpClientConfig>- Returns:
- the global
AddressResolverGroup
-
bindAddress
- Overrides:
bindAddressin classTransportConfig
-
channelType
- Overrides:
channelTypein classClientTransportConfig<HttpClientConfig>
-
defaultConnectionObserver
- Overrides:
defaultConnectionObserverin classClientTransportConfig<HttpClientConfig>
-
defaultLoggingHandler
- Specified by:
defaultLoggingHandlerin classTransportConfig
-
defaultLoopResources
- Specified by:
defaultLoopResourcesin classTransportConfig
-
defaultMetricsRecorder
- Specified by:
defaultMetricsRecorderin classTransportConfig
-
defaultOnChannelInit
- Overrides:
defaultOnChannelInitin classClientTransportConfig<HttpClientConfig>
-
loggingHandler
- Overrides:
loggingHandlerin classTransportConfig
-
metricsRecorder
protected void metricsRecorder(@Nullable Supplier<? extends ChannelMetricsRecorder> metricsRecorder) - Overrides:
metricsRecorderin classTransportConfig
-
proxyProvider
- Overrides:
proxyProviderin classClientTransportConfig<HttpClientConfig>
-
proxyProviderSupplier
- Overrides:
proxyProviderSupplierin classClientTransportConfig<HttpClientConfig>
-
resolverInternal
- Overrides:
resolverInternalin classClientTransportConfig<HttpClientConfig>
-