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) Return theChannelInitializerthat will be used for initializing the channel pipeline.Return the associatedChannelOperations.OnSetup, config implementations might override this.channelType(boolean isDomainSocket) Return the channel type this configuration is associated with, it can be one of the following.Return theConnectionProvider.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 ConnectionObserverReturn the configured defaultConnectionObserver.protected LoggingHandlerReturn the defaultLoggingHandlerto wiretap this transport.protected LoopResourcesReturn the defaultLoopResourcesfor this transport.protected ChannelMetricsRecorderReturn the configured metrics recorder.protected ChannelPipelineConfigurerReturn the default callback if any orChannelPipelineConfigurer.emptyConfigurer().@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) Obtains immediately theChannelMetricsRecorderfrom the providedSupplier.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
Description copied from class:TransportConfigReturn the associatedChannelOperations.OnSetup, config implementations might override this.- Overrides:
channelOperationsProviderin classTransportConfig- Returns:
- the associated
ChannelOperations.OnSetup
-
connectionProvider
Description copied from class:ClientTransportConfigReturn theConnectionProvider.- Overrides:
connectionProviderin classClientTransportConfig<HttpClientConfig>- Returns:
- the
ConnectionProvider
-
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) Description copied from class:TransportConfigReturn theChannelInitializerthat will be used for initializing the channel pipeline.- Overrides:
channelInitializerin classTransportConfig- Parameters:
connectionObserver- the configuredConnectionObserverremoteAddress- the remote addressonServer- channel initializer for the server or for the client- Returns:
- the
ChannelInitializerthat will be used for initializing the channel pipeline
-
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
Description copied from class:TransportConfigReturn the channel type this configuration is associated with, it can be one of the following.- Overrides:
channelTypein classClientTransportConfig<HttpClientConfig>- Parameters:
isDomainSocket- true ifDomainSocketChannelorServerDomainSocketChannelis needed, false otherwise- Returns:
- the channel type this configuration is associated with
-
defaultConnectionObserver
Description copied from class:TransportConfigReturn the configured defaultConnectionObserver.- Overrides:
defaultConnectionObserverin classClientTransportConfig<HttpClientConfig>- Returns:
- the configured default
ConnectionObserver
-
defaultLoggingHandler
Description copied from class:TransportConfigReturn the defaultLoggingHandlerto wiretap this transport.- Specified by:
defaultLoggingHandlerin classTransportConfig- Returns:
- the default
LoggingHandlerto wiretap this transport
-
defaultLoopResources
Description copied from class:TransportConfigReturn the defaultLoopResourcesfor this transport.- Specified by:
defaultLoopResourcesin classTransportConfig- Returns:
- the default
LoopResourcesfor this transport
-
defaultMetricsRecorder
Description copied from class:TransportConfigReturn the configured metrics recorder.- Specified by:
defaultMetricsRecorderin classTransportConfig- Returns:
- the configured metrics recorder
-
defaultOnChannelInit
Description copied from class:TransportConfigReturn the default callback if any orChannelPipelineConfigurer.emptyConfigurer().- Overrides:
defaultOnChannelInitin classClientTransportConfig<HttpClientConfig>- Returns:
- the default callback if any or
ChannelPipelineConfigurer.emptyConfigurer()
-
loggingHandler
- Overrides:
loggingHandlerin classTransportConfig
-
metricsRecorder
protected void metricsRecorder(@Nullable Supplier<? extends ChannelMetricsRecorder> metricsRecorder) Description copied from class:TransportConfigObtains immediately theChannelMetricsRecorderfrom the providedSupplier.- Overrides:
metricsRecorderin classTransportConfig- Parameters:
metricsRecorder- a supplier for theChannelMetricsRecorder
-
proxyProvider
- Overrides:
proxyProviderin classClientTransportConfig<HttpClientConfig>
-
proxyProviderSupplier
- Overrides:
proxyProviderSupplierin classClientTransportConfig<HttpClientConfig>
-
resolverInternal
- Overrides:
resolverInternalin classClientTransportConfig<HttpClientConfig>
-